Forum Discussion
tppegu
15 years agoContributor
Picture is a method of onscreen objects such as the desktop. That method returns an object of type Picture, which in turn has a SaveToFile method. You need to add () to call the Picture method, then call the SaveToFile method on the object you get back, as follows:
function picture()
{
var PictObj;
PictObj = Sys.Desktop;
PictObj.Picture().SaveToFile("C:\\TEMP\\test.jpg");
}
This is an equivalent function, which may be a bit clearer:
function picture()
{
var pic = Sys.Desktop.Picture();
pic.SaveToFile("C:\\TEMP\\test.jpg");
}
Related Content
- 12 years ago
Recent Discussions
- 21 hours ago
- 21 hours ago
- 5 days ago