Re: Wait Until Process Completion
Re: Wait Until Process Completion
- Subject: Re: Wait Until Process Completion
- From: "Mark J. Reed" <email@hidden>
- Date: Tue, 13 May 2008 09:18:21 -0400
Luther> If I'm reading the responses correctly, then this should work in both
Luther> Leopard and Tiger.
Luther> repeat
Luther> delay 1
Luther> try
Luther> do shell script "ps -p " & pid
Luther> if not (the result contains pid) then error
Luther> on error
Luther> exit repeat
Luther> end try
Luther> end repeat
Yup, that'll work.
Yvan> repeat
Yvan> delay 1
Yvan> try
Yvan> do shell script "ps -p " & pid
Yvan> if not (the result contains pid) then exit repeat
Yvan> end try
Yvan> end repeat
But that won't; it'll loop forever on Leopard. If you put the
result-contains-pid check outside the try, though, then it should
work. Also, if you're going to use an English-like language, might as
well go all the way:
repeat
delay 1
try
do shell script "ps -p" & pid
end try
if the result doesn't contain pid then exit repeat
end repeat
--
Mark J. Reed <email@hidden>
_______________________________________________
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