Re: How to get scripting to work without NSApplication
Re: How to get scripting to work without NSApplication
- Subject: Re: How to get scripting to work without NSApplication
- From: "Neal A. Crocker" <email@hidden>
- Date: Wed, 12 Dec 2001 01:21:24 -0800
On Monday, December 10, 2001, at 10:09 , Neal A. Crocker wrote:
Did you add the NSAppleScriptEnabled setting (with string value
YES) to your application settings in your project?
Neal.
P.S., I've actually used the NSAppleEventManager class to register
a handler for a nonsensical event ("foo bar ") in a Cocoa
application and when I send this nonsensical event from a script to
my Cocoa app, the handler is invoked. It may be that the
"aevtquit" event that you are interested in is special somehow.
You could test this by trying to register for a nonsensical event
and sending it from a script to your app as I did. If it doesn't
work, I would guess you're using NSAppleEventManger wrong. If you
could post or mail the part of your code that deals with
registration and the handler code, I could take a look at it.
Also, I could post my test project to my IDisk web page for you to
take a look at.
I for one would be interested in seeing your code sample!
I put my sample code (a Mac OS X Project Builder Project called
AELogger) on my IDisk website
(
http://homepage.mac.com/nealackercrocker/FileSharing.html). A
direct link to the compressed project is given by
(
http://homepage.mac.com/nealackercrocker/.cv/nealackercrocker/Public/AELogger Example.sea.hqx-binhex.hqx).
Be forewarned, the AELogger project is an abortive attempt to do
something which I won't go into, so it's overall structure might not
make much sense. However, it illustrates how to succussfuly use the
NSAppleEventManger class to register a handler for an appleevent (in
this case, a nonsense event with class "foo " and id "bar "). You
can test out the handler with an applescript I included.
Neal.