Mac drop file on standalone, process, and quit

ilsa ilivecode at gmail.com
Thu Feb 23 23:55:01 EST 2012


Hi:

Thanks. I was trying the below in my stack script, which I got from a
Jacquie message on the list:

global gFP

on appleEvent pClass, pID
   if pClass is "aevt" and pID is "odoc" then
     -- the file path is in the appleEvent data
     request appleEvent data
     put it into gFP
     -- open the file here
     put gFP into field "gFP" of card 1
   else
     pass appleEvent
   end if
end appleEvent

But the standalone I build doesn't respond, and the field doesn't get populated.

Thanks,

ilsa

On Thu, Feb 23, 2012 at 8:40 PM, Richard Gaskin
<ambassador at fourthworld.com> wrote:
> ilsa wrote:
>> I've searched the list but haven't found out how to do a very simple
>> thing: drop an image file, or a bunch of image files, onto a
>> standalone and have it process them all and then quit. So I could have
>> the app in the Dock and drop files on it. I have the image processing
>> part down, but getting the standalone to recognize the drop, do the
>> process on each file and then quit has proved impossible for me. Is
>> there a tutorial or example anywhere? Or ideas on a better process?
>> This is for LiveCode 5.02 and Mac OS X 10.5.
>
> The trick here is to trap the appleEvent message, taking action on the
> 'odoc' event.  See the dictionary for the appleEvent message, and also
> the request command to obtain the list of files.
>
> --
>  Richard Gaskin
>  Fourth World
>  LiveCode training and consulting: http://www.fourthworld.com
>  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
>  LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
>
> _______________________________________________
> 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