Re: Error handling?
Re: Error handling?
- Subject: Re: Error handling?
- From: Shane Stanley <email@hidden>
- Date: Mon, 09 Mar 2015 17:24:14 +1100
On 9 Mar 2015, at 3:58 pm, Dave C <email@hidden> wrote:
I want the script to eject the volume and if the volume is busy, just wait until it isn’t busy.
So try this:
set thePosixPath to POSIX path of alias "Moe" repeat try do shell script "diskutil eject " & quoted form of thePosixPath exit repeat -- succeeded, all's good on error errMessage number errorNum delay 30 -- try again in 30 seconds end try end repeat
on delay delayTime set theRepeat to delayTime * 10 div 1 repeat theRepeat times do shell script "sleep 0.1" end repeat end delay
|
_______________________________________________
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