Screenshot Window
Verb: printWindow
Available from: <Standard>
Takes a screenshot of a window.
Syntax
printWindow [--safesearch(Boolean)] [--window(Window)] (Image)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--safesearch | Safe Search | Optional | Boolean | When enabled, focus on the window and get a higher quality image.
This setting slows down execution. |
--window | Window | Optional | Window | Window for the screenshot.
When this parameter is left blank, the screenshot is obtained from the window currently attached to the context. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Image | Image | Returns the image obtained from the screen. |
Example
The Launch and Attach Window command opens a Notepad window. Then, the Screenshot Window command takes the screenshot of the window and returns it as an image in a variable. With the Save Image command, it is possible to name and save the image in an informed directory.
defVar --name notepadWindow --type Window
defVar --name imageName --type Image
defVar --name desktop --type String
defVar --name imagePath --type String
getSpecialFolder --folder "Desktop" desktop=value
launchWindow --executablepath "notepad.exe" notepadWindow=value
printWindow --safesearch --window ${notepadWindow} imageName=value
saveImage --image ${imageName} --directory "${desktop}" --file windowImage --format "Png" imagePath=value
logMessage --message "${imagePath}" --type "Info"
// Take a screenshot of an open Notepad window.
In the Directory parameter of the Save Image command, the directory where the image should be saved must be informed.