How to applescript the 'grab' application

0

1

I am trying to write an apple script to use the "Grab" application in the Utilities folder to capture and print an application's window.

I can get to the part where I tell Grab to start window capture mode, but I can't seem to script clicking of another applications window to cause the correct window to be captured.

I have tried the "click at {x,y}" without success. All of the screen capture scripts I have found thus far do entire screen only with a command line tool. Does anyone have any suggestions?

Peter B

Posted 2012-09-12T18:49:59.733

Reputation: 323

Answers

2

You can use screencapture -l to target a specific window.

-l<windowid> capture this windowsid

You can find the IDs with AppleScript or Quartz Debug.

Lri

Posted 2012-09-12T18:49:59.733

Reputation: 34 501

oh, very cool! Had not thought of that... – Peter B – 2012-09-24T19:49:12.487