Launching Preview

Jim Hurley jhurley0305 at sbcglobal.net
Thu Nov 21 09:47:09 EST 2013


Hi Roger,

Thanks. This level of Apple Script is over my head, I'm afraid.

I tried it, but "theGroup" didn't show up in Preview.

I'm surprised that LC doesn't have a more direct way of getting a snapshot into Preview than first creating a file to disk, i.e.

      export snapshot from rect (rect of  graphic "oval") of this card  to file tPathAndName as PNG
      launch document tPathANDNAME

Might there be a way to launch Preview and then "activate" the "New from clipboard" within Preview? Not sure what I mean by "activate." 

Jim Hurley

> 
> Message: 6
> Date: Wed, 20 Nov 2013 13:13:29 -0500
> From: Roger Eller <roger.e.eller at sealedair.com>
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Subject: Re: Launching Preview
> Message-ID:
> 	<CAAT6EXOD5n-XTppehu0eGYXBJBygGHT=XwFfDAQq6LiYoUDQQQ at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> 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
> 





More information about the use-livecode mailing list