Droplets and AppleEvents
Dave
dave at looktowindward.com
Tue Feb 27 10:38:38 EST 2007
Hi,
I have an application that is built into a standalone. If the app is
launched by double-clicking it then I want to display a (prefs)
window (whether the app is already running or not) if the app is
launched by dragging and dropping a file into the App's Icon, then I
want to process the file(s).
I have my Standalone structured so that a Splash Screen is made into
a Standalone and it calls other Stacks inside the App bundle. This
all works fine. However, if I launch the app, let the Splash Screen
Splash, then drag and drop a file onto the App Icon, the Icon
Highlights as expected but I don't get the AppleEvent - ever. If in
the secondary stack I press a button that simply has this script
attached:
on mouseUp
answer "Hello World"
end mouseUp
I get the "Hello World" dialog then hit ok and then AppleEvents seem
to get thru, e.g. I can drag and drop files onto the Apps Icon and
the appleEvent handler below runs and I get the "odoc" event.
Here is the AppleEvent Script handler in the Stack Script of the
Splash Screen:
------------------------------------------------------------------------
-----------------
--
-- appleEvent
--
------------------------------------------------------------------------
---------------
on appleEvent theClass,theID
local myAppleEventData
request appleEvent data
put it into myAppleEventData
answer "theClass: " & theClass & " theID: " & theID & cr & "Data:
" & myAppleEventData
pass appleEvent
end appleEvent
Any ideas on how I can make this work correctly??
Thanks a lot
All the Best
Dave
More information about the use-livecode
mailing list