More Droplets and AppleEvents

Dave dave at looktowindward.com
Tue Feb 27 12:36:17 EST 2007


Hi,

I can't find any information on how this is supposed to work. The  
built-in documentation says that the appleEvent message is sent to  
the current card, however I have the appleEvent message handler in my  
Stack Script and it gets called. So where exactly is the message sent  
to?

  The Splash Screen Stack used to just be hidden, I now close it so  
that there would be no chance that appleEvents get sent it it,  
however, I still sometimes get the appleEvent handler in the Splash  
stack is getting called, even though it is closed and gone!!!! How  
can this be? This is the handler:


on appleEvent theClass,theID
   local myAppleEventData

   if (the environment <> "development") then
     request appleEvent data
     put it into myAppleEventData
     answer the name of me & cr & "theClass: " & theClass & "  theID:  
" & theID & cr & "Data: " & myAppleEventData
   end if

   pass appleEvent
end appleEvent


I have this in the Splash Screen Stack and the Main Stack. I have a  
number of other stacks that are open, one is a Place Holder for  
loading externals and a couple that hold global functions. I'm  
guessing that these stacks are eating the appleEvents. IMO, the way  
in which appleEvents are handled needs to be improved. It's senseless  
to have the appleEvent sent to the current card or even the current  
stack, they should always be sent to one place. My suggestion would  
be to have a global property that specifies the stack to send the  
message to, e.g.

set the appleEventStack to "myAppleEventStack"

Anyway, is there any secret on how to have this work?

Thanks a lot
All the Best
Dave
------------------------------------------------------------------------ 
------------------------------------
Hi,

I added an AppleEvent handler to the Main Window Stack and I now get  
the the AppleEvents ok. I had thought that the Splash Screen would  
always get the message. What is the action here? If the user drops a  
file into the Standalone Icon, where should the AppleEvent get sent?

One other thing, I want to give my App a Creator type of CR01, but I  
want to be able to Drop Movie Files into it. How do I go about  
setting this up in the Standalone settings dialog.

Thanks a lot
All the Best
Dave

------------------------------------------------------------------------ 
------------------------------------

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





_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



More information about the use-livecode mailing list