System Actions
Comment
Set Variable

| *Tip:
If you want to set the value to the result of a Math Calculation, you must precede the formula with an equals sign "=", just like Excel.
In Excel, if you enter "1 + 1", you will get "1 + 1". If you enter "=1+1", you will get "2". vTask Studio works the exact same way. |

| *Tip: To evaluate whether a variable is NULL, exists, or has an empty value, use the IF Variable check. |
Delete Variable
| *Tip: To evaluate whether a variable is NULL, exists, or has an empty value, use the IF Variable check. |
Increment Variable
Decrement Variable
Set Environment Variable


Set Step Delay
*Tip:
To provide maximum performance while running scripts, be sure that:
|
vTask Setting Change
| vTask Option | Description |
| Run Tracking | Shows or hides the run tracking popup |
| Logging | Activates or deactivates vTask run logging |
| Highlight Current Step | Starts or stops the tracking of the current step in the script |
Write to Output


Write to Log
Set Clipboard Text
Paste Clipboard
Clear Clipboard
Image Capture
| *Tip:
Also see the related Grid Snapshot to Clipboard feature.
|



Logoff
Restart
Shutdown
Windows API


| *Tip:
The sample files included with vTask and the examples below demonstrate correct syntax for many functions.
Use them as templates for your own function calls.
|
|
Standard user message: MessageBox( 0, "Direct call into Win API", "Title here", MB_OK ) MessageBox with "MB_YESNOCANCEL" and "MB_ICONERROR": MessageBox( 0, "Yes/No/Cancel with Error icon", "Title", MB_YESNOCANCEL+MB_ICONERROR ) Returns screen width: GetSystemMetrics( SM_CXSCREEN ) Returns screen height: GetSystemMetrics( SM_CYSCREEN ) Sends "WM_SYSCOMMAND + SC_RESTORE" to a window: SendMessage( %hWnd, 274, 61728, 0 ) Copies a file: CopyFile( "c:\filename1.txt", "c:\filename2.txt", 0 ) Use the Windows Shell to open a file: ShellExecute( 0, "open", "c:\filename.txt", 0, 0, 1 ) Sounds the speaker: Beep( 1000, 250 ) Flashes the top window: FlashWindow( %hWnd, 1 ) |
|
Empties the clipboard: Step #1: OpenClipboard(%hWnd) Step #2: EmptyClipboard() Step #3: CloseClipboard() |
|
Demonstrates accessing a return string: Step #1: Delete Variable %title Step #2: GetWindowText( %hWnd, %title, 512 ) Step #3: Display Message: "%title" |
|
Moving a window to a new location: Step #1: Use Window: "Untitled - Notepad" Step #2: MoveWindow( %hWnd, 10, 10, 200, 200, 1 ) |
|
Checks a pixel color in a window: Step #1: Start Program: notepad.exe Step #2: Use Window: "Untitled - Notepad" Step #3: %hdc = GetDC( %hWnd ) Step #4: %color = GetPixel( %hdc, 100, 100 ) Step #5: ReleaseDC( %hWnd, %hdc ) Should be "16777215", which is "#FFFFFF" (white): Step #6: Display Info Message: %color |
|
Draws a diagonal red line on the screen: Step #1: Set Run Speed 10 Step #2: %hdc = GetDC( 0 ) Step #3: Start For Loop: 50 loops Step #4: SetPixel( %hdc, {loopcount}, {loopcount}, 255 ) Step #5: End Loop Step #6: ReleaseDC( 0, %hdc ) |
|
Access a file handle for low-level I/O: Step #1: %file = CreateFile( "c:\test_file.txt", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL ) Step #2: WriteFile( %file, "test", 4, "", 0 ) Step #3: CloseHandle( %file ) |
|
Various system-level "C" string functions: %length = lstrlen( "abc" ) %difference = lstrcmp( "abc", "xyz" ) %substring_exists = StrStr( "abc123", "bc" ) |