• 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
Explicit run handler usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Explicit run handler usage


  • Subject: Explicit run handler usage
  • From: "email@hidden" <email@hidden>
  • Date: Sat, 17 Apr 2010 22:04:00 +0100

In the following ASOC myTasker becomes connected to an instance of myTask when the nib is loaded.
The app loads and  myTask executes.

My questions are:

1. myTask isn't an NSObject subclass - yet it works. Is it safe to assume that this will always be the case?
2. if I change the code to use an explicit run handler (version 2) the run handler does not get called. Why?

=========
VERSION 1
=========

-- file 1.applescript
script cocoa_applescript_testAppDelegate

	property parent : class "NSObject"
	property myTasker : missing value

	on applicationWillFinishLaunching_(aNotification)
		tell myTasker to execute()
	end applicationWillFinishLaunching_

end script

-- file 2.applescript
script myTask
	on execute()
		display dialog "here"
	end execute

end script

=========
VERSION 2
=========

-- file 1.applescript
script cocoa_applescript_testAppDelegate
	property parent : class "NSObject"
	property myTasker : missing value

	on applicationWillFinishLaunching_(aNotification)
		tell myTasker to run
	end applicationWillFinishLaunching_

end script

-- file 2.applescript
script myTask
	on run
		display dialog "here"
	end run

end script



Regards

Jonathan Mitchell

Developer
http://www.mugginsoft.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: Christopher Nebel <email@hidden>
    • Re: Explicit run handler usage
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Scripting Illustrator and Photoshop.
  • Next by Date: Compiling ASOC
  • Previous by thread: Scripting Illustrator and Photoshop.
  • Next by thread: Re: Explicit run handler usage
  • Index(es):
    • Date
    • Thread