How to tell if "Save" failed
How to tell if "Save" failed
- Subject: How to tell if "Save" failed
- From: email@hidden
- Date: Fri, 9 Sep 2005 20:20:45 -0700 (PDT)
This must be obvious, but how can I tell if a "Save" failed?
I have a script that makes a copy of a movie, changes the copy, saves the
copy, deletes the original, and saves the copy in place of the original.
I'd like to be able to tell along the way if the "saves" have succeeded or
failed.
I thought that I could do this with a try/on error, but I can't figure out
how to make that work. In the following shortened script, I have set
"replacementPath" to a folder that doesn't exist. The script fails to
"save self contained movie 1 in file (replacementPath)" but I don't get
the display dialog ("Error 2") message.
-- START SAMPLE SCRIPT
set replacementPath to "hd:noSuchFolder:testMovie.mov"
tell application "QuickTime Player"
activate
try
open (choose file)
on error
display dialog ("Error 1")
end try
try
save self contained movie 1 in file (replacementPath)
on error
display dialog ("Error2")
end try
try
close movie 1
on error
display dialog ("Error 3")
end try
end tell
--END SAMPLE SCRIPT
Note, my goal isn't to save a file in a non-existent folder, my goal is to
display a dialog if my "save self contained movie 1 in file
(replacementPath)" statement fails.
--Cha
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden