Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
oh, very cool! Had not thought of that... –  Peter B Sep 24 '12 at 19:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.