Re: "idle" has different effect in X vs 9?
Re: "idle" has different effect in X vs 9?
- Subject: Re: "idle" has different effect in X vs 9?
- From: Andrew Oliver <email@hidden>
- Date: Thu, 08 May 2003 03:46:34 -0700
Your interpretation of the idle() handler is incorrect.
In an idle handler, the return value tells AppleScript "go away, and come
back again in x seconds", meaning the idle handler will be called again in x
seconds time. It does not introduce any inherent delay itself, other than
the time it takes to run the other commands in the idle handler.
Instead, consider using the delay command:
delay 10
Will add a 10 second delay to your script.
As for why the difference under Mac OS 9.x, I can't say.
Andrew
:)
On 5/8/03 2:51 AM, "Charles Arthur" <email@hidden> wrote:
>
Hi..
>
>
I've got a short script which delays, at startup, the launch of Eudora so
>
that the proxy mail filter I use (called PostArmor, to stop spam) can get
>
started. Otherwise, Eudora tries to check the mail before PostArmor is
>
started, and errors.
>
>
This works fine in OS9 - it delays Eudora (through the idle loop) just long
>
enough. In OSX, however, the script seems to let Eudora get started too
>
quickly. The settings changes to Eudora are OSX-specific, but it's
>
otherwise the same script (in terms of the structure, idle loop and other
>
things) as in 9.
>
>
Thoughts? Here's the script:
>
--
>
property chooseapp : ""
>
>
on run
>
if chooseapp is "" then set chooseapp to choose application with
>
prompt "Where is Post Armor X?"
>
set nowquit to false
>
tell chooseapp to run -- start PostArmor
>
idle (nowquit) -- idle for 10 seconds to let PostArmor start
>
set nowquit to true
>
with timeout of 1000 seconds
>
tell application "Eudora"
>
set setting 1 to "Verdana"
>
set setting 260 to 1 -- 1=off | 0= on ; turns off
>
format=flowed
>
set setting 6820 to 8110
>
activate
>
end tell
>
end timeout
>
if nowquit is true then tell me to quit
>
end run
>
>
on idle (nowquit)
>
if nowquit is true then tell me to quit
>
return 10 -- wait for 10 seconds before exiting the idle loop.
>
end idle
>
--
>
Charles
_______________________________________________
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.