Re:applescript-users digest, Vol 3 #952 - 16 msgs
Re:applescript-users digest, Vol 3 #952 - 16 msgs
- Subject: Re:applescript-users digest, Vol 3 #952 - 16 msgs
- From: email@hidden
- Date: Tue, 8 Oct 2002 21:35:46 -0400
On Tuesday, October 8, 2002, at 02:32 AM, Paul Berkowitz wrote:
>
For example, the following handler causes a stay-open script
>
application to
>
beep every 30 seconds after it has been launched.
>
>
on idle
>
beep
>
end idle
I found it very informative to write the following test monkey:
on run
say "Run"
end run
on idle
say "Idle"
return 5
end idle
on myHandler()
say "Handler"
end myHandler
Save it as a stay open applet, and give it more than the default amount of
memory ("say" needs more memory than the default, at least in OS's <= 9.)
Then, stimulate it with the following types of actions (from Script Editor is
OK):
launch application "Test Monkey"
-- Script loads, nothing happens
tell application "Test Monkey" to myHandler()
-- "Handler" happens, immediately followed by "Idle".
Compare that with
tell application "Test Monkey" to myHandler()
This time, you'll see the run handler invoked.
The upshot is that its very difficult to ensure something will get initialized
before its used, as long as other scripts can launch an application and avoid
its run handler from begin invoked.
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.