Mac drop file on standalone, process, and quit

Andre Garzia andre at andregarzia.com
Fri Feb 24 14:44:23 EST 2012


Folks,

I think that AppleEvents are not authorized on the new Mac App Store rules
right?

Silly Apple...

Andre

On Fri, Feb 24, 2012 at 4:24 PM, J. Landman Gay <jacque at hyperactivesw.com>wrote:

> 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
>
>
> ______________________________**_________________
> 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<http://lists.runrev.com/mailman/listinfo/use-livecode>
>



-- 
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.



More information about the use-livecode mailing list