• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Explicit run handler usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Explicit run handler usage
      • From: "email@hidden" <email@hidden>
References: 
 >Explicit run handler usage (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: Compiling ASOC
  • Next by Date: Re: Compiling ASOC
  • Previous by thread: Explicit run handler usage
  • Next by thread: Re: Explicit run handler usage
  • Index(es):
    • Date
    • Thread