Script Execution


  Run
 

Run executes the command steps in sequence. It always starts with the first step at the top of the script. Processor time is shared with other applications. It is possible (although not recommended) to work in other applications while vTask is running a file.


  Run From Here
 

The Run From Here option is also available in the right-click menu, as well as the toolbar. It functions as a "continue" command - it starts running the file on whichever step is currently highlighted. It continues running the file the same as the Run command, until it either gets to the end or encounters a breakpoint.

The "-s" command line switch provides the same functionality. This allows you to automate the "Run from Here" feature from the command line or from a batch file.


  Run Single Step
 

The Run Single Step command helps with debugging your vTask files. Sometimes it is necessary to run steps individually. You can also choose this command by clicking on a step to highlight it, and then right-mouse clicking and choosing Run Single Step in the menu that appears. The step will be run once and then execution will stop. If the command is successful, the status bar will indicate that it was successfully run. If the step fails, a message will appear indicating the error. You may see further information concerning the failure in the logfile.

You can use this button to "step through" a script by pressing it multiple times, since it will run each command, and then progress to the next step. All state information is maintained between steps, which allows you to even step through loops.

Be sure to set the active window before running a single step that needs to work in a specific program. You can do this by running a single "Activate Window" step, and vTask will remember the window that you last activated, and will display its title in the status bar. If you don't set the window, the commands will execute against whatever window is visible.


    Pause / Resume
 

The Pause button allows you to freeze a script during execution. This is a full process halt, which implies that the execution is suspended at the core CPU-level of the computer. This means that the execution halt can occur absolutely anywhere, even during the middle of a step or halfway through a completed action.

Once this button is pressed, its icon changes to a "Resume" image:
When Resume is pressed, execution will then continue with the exact instruction where it was paused. A script can be paused and continued as many times as needed.


  Stop
 

The Stop option lets you terminate a run before it completes. The last line executed will be highlighted, and the status bar will show the last result. The Stop command terminates all execution, even a Recording that is in progress.

You can also press the "Stop Button" key on the keyboard, which is set in Tools - Options. The stop key is performed asynchronously, so it can occur anywhere during a run.

If you are trying to pause at a specific step, use the "Breakpoint" command instead. You can resume execution by pressing the "Run From Here" command.
There are multiple options for running portions of a file:



  Show Run Results
 

The "Show Run Results" feature of vTask allows you to visually see the success or failure of each step that was run. After a run, each step that was successful will be light green, and each failure will be light red. "IF" steps that do not evaluate to TRUE are also shown in light red. Steps that were not run remain in white (uncolored).

In the example below, you can see that the first IF Expression evaluated to FALSE, which caused vTask to run the ELSE block. An additional checkpoint also failed at the bottom.



Comments, Skipped Steps, and Breakpoints do not change color after a run. The color of run results can be customized in the Options screen. You can clear the results of a previous by selecting the "Reset Run Results" menu item under "Run".


  Run Tracking
 

The "Run Tracking" feature of vTask displays an unobtrusive message in the corner of the screen that shows what's happening at the moment. The message display will include the script filename, step number, loop number (if in a loop), and the action being executed (and command text if available). The Run Tracking also works for called scripts and compiled script. The appropriate file name is shown in the display.

The background color of the display is the same as the "Run Success" color that is selected in Tools - Options - Colors  (as shown above in the "Show Run Results" section, the default is light green).

The message can be placed in any corner of the screen, or if desired, at any pixel coordinate by manually adjusting the registry entry "HKEY_CURRENT_USER\Software\vTask\RunTrackingX, Y"

The transparency (of "alpha" channel) of the the display can also be adjusted from 0% (hidden) to 100% (full visible). To not display the Run Tracking, set the visibility to 0%, or uncheck the "Show Run Tracking" item under the View menu. Here is a sample using transparency (75%) and full visibility (100%):





The settings for the Run Tracking can be adjusted in the Tools - Options - Log screen.



To disable Run Tracking, you can either turn off the "Show Run Tracking" option (above), or deselect the "Show Run Tracking" menu item under the View menu:



*Tip:  Also see the "vTask Setting Change" command which has a "Run Tracking" setting.
The Run Tracking popup message will automatically disappear after 3 seconds of inactivity. You can set the popup to disappear at your desired interval with a Registry key, which is automatically created by vTask:

HKEY_CURRENT_USER\Software\vTask\RunTrackingTimeout


The value is a REG_DWORD and is "milliseconds" (1000=1 second, etc). To keep it up all the time, use a sufficiently high number, such as "999999" (that's 16 minutes; it's not possible to use negative values since it's unsigned, and can't be zero since that scenario exists when no vTask installed). The default is 3000 (3 seconds).