Re: Idle handling, just not grokking it.
Re: Idle handling, just not grokking it.
- Subject: Re: Idle handling, just not grokking it.
- From: "Connor W. Anderson" <email@hidden>
- Date: Thu, 15 Nov 2001 12:05:15 -0600
on 11/15/01 11:28, email@hidden at
email@hidden wrote:
>
The idle handler is working correctly. I just tried it in AppleScript 1.7
>
under Mac OS X 10.1.1, and added a display dialog in each branch of the 'if'
>
test in the idle handler, and also in each of the script objects. The
>
resulting dialogs progressed properly through Stage 1, Stage 2, and Stage 3,
>
then back to the beginning.
>
>
What isn't working is the beeps. The simple script 'beep 2' or 'beep 3' only
>
beeps once. I just verified this in AppleScript 1.7. How could it not work
>
in AppleScript 1.4 and 1.7? My old Script Additions guide says this is
>
proper syntax. I'm missing something here, myself.
Well, it is some small solace that I'm not crazy or blatantly stupid.
However, I just tried your variation with display dialogs along the lines
of:
global theScript
script Stage1
display dialog ("Stage1")
end script
script Stage2
display dialog ("Stage2")
end script
script Stage3
display dialog ("Stage3")
end script
on idle
run script theScript
if theScript is Stage1 then
set theScript to Stage2
else if theScript is Stage2 then
set theScript to Stage3
else
set theScript to Stage1
end if
return 5
end idle
on run
set theScript to Stage1
end run
The apple event monitor just shows script start, script finish. The result
panel just shows, display dialog ("stage1") and no dialog boxes appear.
Save the script as an application. Nothing happens.
What doesn't seem right to me (because of my ignorance of the deeper levels
of AppleScript) is why the 'run script' statement is not in the on run
statement? I mean, what initiates the idle handler to run script theScript?
Is on idle by default a "run" statement?
Quite frustrated. I have all the separate scripts configured and tested
(there are eight of them by the way) and would like to be able to do it via
the idle handler, rather than scheduling eight separate script schedules.
--
Connor W. Anderson
Technical Services Manager
Woodward Communications, Inc.
"Being Irish he possessed an abiding sense of tragedy
which sustained him through brief episodes of joy."
- W. B. Yeats