one stay open applet can't start another?
one stay open applet can't start another?
- Subject: one stay open applet can't start another?
- From: "Donald S. Hall" <email@hidden>
- Date: Mon, 03 Dec 2001 00:16:09 -0700
It appears that one stay open applet can't start another one via the 'run
script' command. The second one just runs and quits. Is there any reason for
this? Is there a way around it?
Here are my two scripts, saved as applets, both with "stay open" checked:
-- test script 1 ----------------------------------------------------
global x
global other
global r
on run
set x to 0
beep
set other to (choose file of type {"APPL"}) -- choose test script 2
end run
on idle
set x to x + 1
if x = 1 then set r to run script other
activate me
display dialog "#1 in idle, x=" & x & return & r as text
beep x
if x > 3 then
quit
end if
return 15
end idle
-- end test script 1 --------------------------------------------------
-- test script 2 ------------------------------------------------------
global x
on run
set x to 0
activate me
display dialog "#2 started"
return "#2 ran"
end run
on idle
set x to x + 1
activate me
display dialog "#2 in idle, x=" & x
beep x
if x > 3 then
quit
end if
return 15
end idle
-- end test script 2 ----------------------------------------------------
1. I start the first script and choose test script 2 as 'other'.
2. The run handler of test script 2 runs - verified by dialog.
3. The run handler of test script 2 completes - verified by dialog in test
script 1 idle handler.
4. The idle handler of test script 1 continues to run every 15 seconds till
programmed death.
5. The idle handler of test script 2 never runs at all.
I can run two stay open applets simultaneously if both are launched from the
Finder.
I'm in OS 9, AS 1.6, but I think I will get the same result in OS X 10.1.
Any enlightenment would be greatly appreciated.
Thanks,
Don
--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
http://www.theboss.net/appsmore
email@hidden