Launching Preview

Roger Eller roger.e.eller at sealedair.com
Thu Nov 21 10:34:01 EST 2013


Since I didn't know what you had in your variable theGroup, I made an
actual group named "theGroup" with visible objects in it.  It works
perfectly of you have a group named "theGroup".  As far as the AppleScript,
I just googled that.  All it does is sets the focus on Preview.app, then
sends the equivalent to pressing Apple-N to Preview.app as a system event.

~Roger


On Thu, Nov 21, 2013 at 9:47 AM, Jim Hurley <jhurley0305 at sbcglobal.net>wrote:

> 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
> >
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list