Re delaying a script
Re delaying a script
- Subject: Re delaying a script
- From: Stefan Eriksson <email@hidden>
- Date: Wed, 19 Jan 2005 21:19:41 +0100
On Jan 19, 2005, at 9:41, email@hidden wrote:
Hi,
My script is using a DO SHELL SCRIPT action,
which returns a result (via the Clipboard).
It would not work, DISPLAY DIALOG result would
not show the correct value, until I realised
that my script would continue running, not
waiting for the DO SHELL SCRIPT to finish.
What I would like to know: What is the accepted
way to wait in AppleScript, without a busy loop?
greetings,
Klaas Punt
I use this one...
set myScript to "man perl"
tell application "Terminal"
activate
do script myScript in window 1
end tell
set isBusy to true
repeat until isBusy is false
tell application "Terminal"
tell window 1
set isBusy to busy as boolean --> Test if busy
end tell
end tell
delay 1 --> Check every second
end repeat
tell me to activate
display dialog "Terminal is No Longer Busy!"
quit application "Terminal"
Cheers , Stefan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden