• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re delaying a script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: title of window 1 as text
  • Next by Date: Re: "Where is application ...?" dialog stopping automation
  • Previous by thread: Re: Text, Unicode Text, and String coercion ...
  • Next by thread: how do I pick which version of AppleScript runs a script?
  • Index(es):
    • Date
    • Thread