Script Editor  
Top  Previous  Next

 
Toolbar:   viewscript  
Menu:   View -> Script  

Use this command to record, edit, debug and execute ImageWarp's scripts.

When you choose this command, the Script Editor window will appear with the following screen elements:

Script File/Edit toolbar
 
Contains commands for opening, saving, recording and copying the scripts. Choose among the following commands:  

scriptnew
New
Create a new script
scriptopen
Open
Load an existing script from disk
scriptsave
Save
Save the current script
scriptcut
Cut
Move the selected text to the clipboard
scriptcopy
Copy
Copy the selected text to the clipboard
scriptpaste
Paste
Past the Clipboard text over the selected text
scriptundo
Undo
Undo the last edit
scriptredo
Redo
Redo the last undo
scriptrecord
Record (F5)
Record your actions to the script
 

Script Run/Debug toolbar
 
Contains commands for executing and debugging the scripts. Choose among the following commands:  
 
scriptrun
Execute (CTRL+F5)
Run the script to completion
scriptpause
Pause
Stop the script at the current line of execution
scriptstop
Stop (SHIFT+F5)
Terminate execution of the script
scriptstep
Step (F10)
Execute to the next line. If the current line is a subroutine or function call, execute that subroutine or function.
scriptstepinto
Step into (F11)
Execute to the next line. If the current line is a subroutine or function call, stop at the first line of that subroutine or function.
scriptstepout
Step out (SHIFT+F11)
Step out of the current subroutine or function call
scriptruntocursor
Run to cursor (SHIFT+F10)
Execute the script and stop it at the current line
scriptreset
Reset (Esc)
Reset the script pointer to the first statement
scriptbreakpoint
Toggle brakepoint (F9)
Insert or remove breakpoint at the current line
scriptbreakremove
Remove brakepoints (F9)
Remove all breakpoints
     

Script View toolbar
 
Contains commands for controlling the appearance of the Script Editor panel windows. Choose among the following commands:  

scripterrors
Show Errors
Show or hide the error window
scriptvariables
Show Variables
Show or hide the watch window
scriptterminal
Show Terminal
Show or hide the terminal window
scriptcommandline
Show Command
Show or hide the command line window
     

Script Command line  
Allows you to enter and execute a single ImageWarp operator:  
 
scriptexecute
Execute
Executes the command from the script command line
 
 
You can also press ENTER to execute the command. The entries in the Command line form the command History that can be accessed by clicking the arrow on the right side of the Command line. This and other properties of the Command line can be adjusted in the .  
 
Source window
 
This is the main window of the Script Editor workspace that contains the source code of the current script. When you apply ImageWarp's functions in the Record mode, the corresponding operators will appear in the Source window, thus generating a new script. You can modify the script by manually editing its code. The following standard key combinations can be used while editing the script:  

CTRL+A
Select All
CTRL+C
Copy selection
CTRL+V
Paste selection
CTRL+X
Cut selection
CTRL+Z
Undo last change
CTRL+Y
Redo last change
CTRL+F
Find
CTRL+H
Find and replace
 
 
The Source window features syntax coloring by using different colors for various code elements, such as keywords or comments. This coloring gives you visual cues about the structure and state of your code. The following colors are utilized:  

Blue
standard keywords of ImageWarp's scripting language
Cyan
built-in mathematical functions and imaging operators
Brown
strings and text expressions
Green
comments
 
 
The Source window allows you to receive the context help on any operator by clicking it and pressing F1. You can also display the tip on a desired ImageWarp function when positioning the cursor over the corresponding operator. The tooltip will show the prototype call and brief description of the function.  
 
Debug margin

Appears as a narrow margin on the left of the Source window and displays the breakpoints and the current execution point. Breakpoints are set by the Toggle Breakpoints (F9) command and displayed as stop-sign icons next to the corresponding statements. If you execute such a script, it will stop at the first encountered breakpoint, and the yellow pointer will appear in the Debug margin marking the statement that will be executed next. You can then step through the script with the Step (F10) and Step Into (F11) commands. Each step will be followed by the corresponding movement of the yellow pointer.  
 
ImageWarp allows you to move the execution point to any desired statement. To do so, double click the corresponding line in the Source window. The yellow pointer will appear next to the statement, marking the new current point of the execution.  
 
Note – changing the execution order of the scripts may render unpredictable results and is recommended for experienced users only.  
 
Variables window
 
When the Script Editor is in the Pause (Debug) mode, this panel appears on the right of the Script window and displays information about variables used in the previous script statements. Both global and local variables are reported. The information is displayed in form of a table consisting of three columns: the name, type and content of each variable. A typical Variables window has the following look:  
 
CLOBAL VARIABLES  
 
Name
type
content
iSize
[integer]
320
fCenter
[floating]
161.76234
ParamName
[string]
Curvature
 
 
Error window
 
This panel appears at the bottom of the Script Editor and displays error messages from the script compiler and run-time error messages. The compiler errors are those that prevent scripts from running, while the run-time errors are encountered during the execution of scripts. An error message includes the line number and brief description of the error. A typical error message would have the following format:  
 
Line 46 error: not enough arguments for sub/function drawLine  
 
To find the script statement corresponding to an error, select the error and double click the corresponding error message.  
 
Terminal window
 
Displays the output generated by the print operator. The Terminal window is detached from the Script Editor workspace, and can be shown or hidden by selecting the Show Terminal button on the Script View toolbar.  
 
Refer to the ImageWarp Language Reference for more details.