• 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: Error handling?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

References: 
 >Error handling? (From: Dave C <email@hidden>)
 >Re: Error handling? (From: "S. J. Cunningham" <email@hidden>)
 >Re: Error handling? (From: Jörgen Stahle <email@hidden>)
 >Re: Error handling? (From: Dave C <email@hidden>)
 >Re: Error handling? (From: Shane Stanley <email@hidden>)
 >Re: Error handling? (From: Dave C <email@hidden>)
 >Re: Error handling? (From: Shane Stanley <email@hidden>)
 >Re: Error handling? (From: Dave C <email@hidden>)
 >Re: Error handling? (From: Shane Stanley <email@hidden>)
 >Re: Error handling? (From: Dave C <email@hidden>)

  • Prev by Date: Re: Error handling?
  • Next by Date: How Can I Access Properties of Script Applications?
  • Previous by thread: Re: Error handling?
  • Next by thread: Re: Error handling?
  • Index(es):
    • Date
    • Thread