Screenshot and Applescript... question

Sarah Reichelt sarah.reichelt at gmail.com
Tue Apr 8 23:57:11 EDT 2008


 >      Went over to mac OSX hints and only found applescripts using shell()
> and 'screen capture'.  I'm looking to get the OSX screenshot to function
> from applescript ( command-shift-3 ).  Can't find an example.
>
>  I can only get 'screen capture' for getting monitor 1. It won't take a png
> of monitor 2, as the OSX native screenshot will.
>
>  ( command-shift-3 ) gets me two full png's of the main monitor and the
> extended desktop.

The shell command screencapture has a parameter "m" that says you only
want to capture the main monitor.
What happens if you leave this out
e.g. get shell("/usr/sbin/screencapture ~/Desktop/Screenshot.png")

I only have one monitor set up here, so cannot test this.

Or using System Events & AppleScript, you can simulate the keystrokes,
like this:
tell application "System Events"
	keystroke "#" using {command down, shift down}
end tell

(The keystroke character in the quotes should be whatever you get when
you type Shift-3.)

HTH,
Sarah



More information about the use-livecode mailing list