>I'm trying to get my application to respond to Apple Events other than the >4 required events and I'm sort of stuck. > >I've implemented the 4 required events as has been described in the FB >manuals and in the articles that appeared in Inside Basic and they seem to >work ok as long as the events are sent by the Finder. Lately, I have been >trying to use AppleScript to send events to my application and things don't >seem to work the same way. If I "tell" my app to "run" from within a script >it sits there in the background as an open process but it doesn't do >anything until I switch to it (I have Program Switcher installed and it >shows up in its list of processes so I can switch to it but it doesn't >appear in the Finder menu of processes until I switch to it in this way). >Once I switch to it everything goes as expected in that the program >"starts" and processes the (apple) events I have sent it from the script. > >In addition to the 4 required events I have installed an AppleScript >specific event processor for the "activate" event (event class=_"misc", >event=_"actv"). I have included the appropriate signature in the _"size" >resource and have an _"AETE" resource that defines the 4 required events as >well as the "activate" event. In fact, the "activate" event gets to my app >and I process it but only after switching to the active but not running app >using Program Switcher. Sounds like I'm always preaching for the proces manager recently :-) What you could do is check if your app is in the fore when it receives the 'run' command it can pull itself forward and then execute it. Look at the process manager examples with FB. However, this seems strange, most apps should run in the background, unless their 'running' needs them to be the foremost. Are you by any chance blocking events when your backgrounding? jonathan ------------------------------------------------------------- ! "format utile" studio de graphisme/graphic design studio ! ! 32 bd de Menilmontant, 75020 Paris, France ! ! phone +33 1 43 49 02 04 +++ fax +33 1 43 49 16 51 ! ------------------------------------------------------------- *** coming soon to a browser near you *** <http://www.cycbercities.com/formatutile> -------------------------------------------------------------