Droplet app with AppleEvent

Mark Schonewille m.schonewille at economy-x-talk.com
Tue Aug 8 10:06:48 EDT 2006


Hi Zax,

Maybe, the answer dialog is not available yet. What happens if you  
try the following in the mainstack of a standalone?

on appleEvent
   beep
end appleEvent

If you don't hear a beep, it looks (sounds) like a bug. I don't  
remember seeing this bug in later versions, you might want to  
download a trial version and try building your application with the  
latest version.

If above script works, you can try the following:

on appleEvent eClass,eID,eSender
   request appleEvent data
   put eClass & return & "id =" && eID & return & "sender =" &&  
eSender & ¬
   return & "data =" && quote & it & quote into myEventData
   send "showEventData myEventData" to me in 10 millisecs
end appleEvent

on showEventData theData
   answer theData
end showEventData

Note that this is just a long shot. I'd have to try myself to be sure  
about this.

Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Download ErrorLib at http://economy-x-talk.com/developers.html and  
get full control of error handling in Revolution.



Op 8-aug-2006, om 15:46 heeft Zax het volgende geschreven:

> [sorry if I made double-post, I encountered mail problems]
>
> Hello,
>
> I would like my app made with Revolution 2.51 to react like a  
> droplet when
> dropping files or folders on the app icon.
> I set "****" as file type and it's ok: dropping something on my app  
> icon
> launches my app.
>
> For testing purpose, I wrote this code in my main stack:
>
> on appleEvent eClass,eID,eSender
>   request appleEvent data
>   answer eClass & return & "id =" && eID & return & "sender =" &&  
> eSender &
> return & "data =" && quote & it & quote
>   pass appleEvent
> end appleEvent
>
> Everything is OK when I drop something onto the app icon *and* my  
> app is
> *already opened*. In this case, "it" contains needed data.
> But when I drop something onto the app icon *and* my app is *not  
> opened*,
> then my app is launched but no AppleEvent is sended :(
> Maybe because the app is not loaded, so it can't receive the  
> AppleEvent?
>
> So, can somebody help me? A droplet must work even the app is not  
> launched,
> otherwise it's not really a droplet! Do I have to add something in my
> "openstack" handler? Or maybe add a "startup" handler with some  
> special code
> in it?
>
> Thanks in advance.
>
> -- 
> Zax




More information about the use-livecode mailing list