Re: Explicit run handler usage
Re: Explicit run handler usage
- Subject: Re: Explicit run handler usage
- From: Shane Stanley <email@hidden>
- Date: Sat, 17 Apr 2010 22:29:20 -0400
- Thread-topic: Explicit run handler usage
On 17/4/10 5:04 PM, "email@hidden" <email@hidden>
wrote:
> 1. myTask isn't an NSObject subclass - yet it works. Is it safe to assume that
> this will always be the case?
Who knows? FWIW, the initial 10.6 release didn't declare a parent in the
template, if that means anything.
> 2. if I change the code to use an explicit run handler (version 2) the run
> handler does not get called. Why?
When you use "tell myTasker to run", I suspect Cocoa is baulking at the AS
keyword. The correct usage would probably be "tell myTasker to |run|()". In
fact, you could make it a class call rather than an instance call and use:
"current application's myTask's |run|()" -- a form that won't even compile
without the pipes, suggesting it's not really legal.
But even with the pipes in the call, it won't work unless you also add the
pipes to the handler itself -- Cocoa just doesn't seem to see a normal run
handler as a method: +[myTask run]: unrecognized selector sent to class
0x20091e3a0. The same goes for idle, open, etc.
--
Shane Stanley <email@hidden>
AppleScript Pro, On Now, Florida <http://www.applescriptpro.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden