Launching Preview

Roger Eller roger.e.eller at sealedair.com
Wed Nov 20 13:13:29 EST 2013


Ok, this one works, and it doesn't matter if Preview is already open.

on mouseUp
   put "tell application" && quote & "System Events" & quote && "to
keystroke" && quote & "n" & quote && "using {command down}" into
tAppleScript
   export snapshot from grp "theGroup" to tempVariable as PNG
   set the clipboardData["image"] to tempVariable
   launch "Preview.app"
   do "tell Preview" & cr & "end tell" as AppleScrpt -- focus on Preview
   do tAppleScript as AppleScript -- Apple-N (New from Clipboard)
end mouseUp

~Roger


>> On Wed, Nov 20, 2013 at 12:33 PM, Jim Hurley <jhurley0305 at sbcglobal.net>wrote:
>>
>>> I am trying to launch a snapshot of a group in Preview.
>>>
>>> Right now I am using:
>>>
>>> case "Print"
>>>          put specialFolderPath("desktop") & "/exported.png" into
>>> theFilePath
>>>          export snapshot from theGroup to file theFilePath as PNG
>>>           launch document theFilePath --On the Mac, the default launch
>>> for a PNG is Preview
>>>          break
>>> end switch
>>>
>>> I'm not sure where I got this--someone in this group, no doubt. Thank
>>> you, whoever you were.
>>>
>>> But I may be using this at a local school, using school computers.
>>> So I was wondering whether it would be possible to do this without
>>> creating a file on  the school's disk. For example:
>>>
>>> case "Print"
>>>          export snapshot from theGroup to tempVariable as PNG
>>>           launch ??? tempVariable
>>>          break
>>> end switch
>>>
>>> Thanks,
>>>
>>> Jim Hurley
>>>
>>>



More information about the use-livecode mailing list