Catching Eject Errors
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.