• 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
Catching Eject Errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Catching Eject Errors


  • Subject: Catching Eject Errors
  • From: Jason Kacmarski <email@hidden>
  • Date: Sat, 29 May 2004 10:05:05 -0700

I'm trying to write a script that will update and then eject my iPod. I'm running into a problem because the script isn't waiting until after the update is complete to eject the iPod, which results in a "disk in use" error. I'm trying to catch the error with a try statement, but it's not working for some reason. Here's the script I'm using:

tell application "iTunes"
set mySource to some source whose name contains "iPod"
update mySource
set ipodName to name of mySource
end tell
tell application "Finder"
try
eject ipodName
on error theErr number errNum
log theErr & " - " & errNum
end try
end tell

The Finder pops up an error dialog every time and doesn't pass the error back to the script. Any ideas on how to either get this error suppressed and passed back to the script so that I can use a delay loop or check whether a disk is in use before ejecting it? Any help would be much appreciated.

Jason
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Catching Eject Errors
      • From: Graff <email@hidden>
  • Prev by Date: Re: Simple if .. else .. then statement
  • Next by Date: Re: Simple if .. else .. then statement
  • Previous by thread: Re: Simple if .. else .. then statement
  • Next by thread: Re: Catching Eject Errors
  • Index(es):
    • Date
    • Thread