Saves the current desktop as a .png file.
System.CaptureScreen(filePath)
Newlook Smartclient only.
Introduced in Version 11.0.10.
filePath- (String, Required)
String value specifying the name (and optional path) of the file to be saved.
The path specified can be absolute or relative to the default Newlook solution folder.
If no file extension is specified in the filePath parameter, this method will add a '.png' extension to the file. If a file name extension other than '.png' is specified, it will be retained however '.png' will be appended to the end of the file name (for example, 'myScreenshot.txt' will become 'myScreenshot.txt.png').
If the file specified already exists, the existing file will be replaced.
This method provides users with a mechanism to capture the current user desktop as a .png file, without a dialog appearing. It is intended to assist in trouble-shooting.
This method returns the final file path of the saved file. Any exception during this save action will generate a runtime error.
The following script captures the current desktop as the file 'myScreen.png' in the folder C:\ScreenCaptures.
function CaptureDesktop()
{
var savedFilePath = System.CaptureScreen("C:\\ScreenCaptures\\myScreen.png");
}
The following script captures the user's desktop as a png file, where it's name is derived from System.User value. The file will be saved in the default Newlook solution path.
function CaptureDesktop()
{
var screenUser = System.Username;
var savedFilePath = System.CaptureScreen(screenUser);
}
The following macros uses the RunMethod action to capture the current desktop as the file 'Error.png' in the default Newlook solution path.
RunMethod(System, CaptureScreen, "Error", vSavedFilePath)
Save method | Debugging scripts | Err object
© 2004-2021 looksoftware. All rights reserved.