Mac drop file on standalone, process, and quit

J. Landman Gay jacque at hyperactivesw.com
Fri Feb 24 13:24:49 EST 2012


On 2/23/12 10:55 PM, ilsa wrote:
> 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.

I don't remember posting that, but I could have, it's a common handler 
that is used by a lot of people. I don't think you need the global 
variable though.

The handler should work, you should see a file path appear in the field 
named "gFP" when you drop a file onto the app icon in the Dock or in the 
Finder. (It won't work if you are dropping files onto the open stack 
window.)

You could add a temporary answer dialog to the "else" clause that would 
tell you if the event is being passed instead of handled. Or add an 
answer dialog before the "if" to see if the handler is running at all.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list