On Apr 11, 2011, at 12:33 PM, louie wrote:
global x
set x to 0
tell application "TextEdit"
activate
end tell
on idle
set x to x + 1
if x ≥ 5 then
if application "TextEdit" is running then
say "working"
else
tell current application
quit
end tell
end if
set x to 0
end if
return 0.5
end idle
Any thoughts?
Why do you have x and why do you want idle to be called every 0.5 seconds, but only test if the application is running every 2.5 seconds?
How about simply:
tell application "TextEdit" to activate
repeat while application "TextEdit" is running
delay 2.5
say "working"
end repeat
If you save that as an application, it will automatically quit once it exits the repeat loop, so there's no need to explicitly "tell current application to quit".
--
Chris Page
The other, other AppleScript Chris
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives:
http://lists.apple.com/archives/applescript-users
This email sent to email@hidden