• 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
How to tell if "Save" failed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to tell if "Save" failed
      • From: kai <email@hidden>
  • Prev by Date: Re: Question about a recurring console message
  • Next by Date: Re: OT: Here we go with another ridiculous OS X question
  • Previous by thread: Re: Will Debbie beat her record of 13 posts from last week (Applescript-users Digest, Vol 2, Issue 594)
  • Next by thread: Re: How to tell if "Save" failed
  • Index(es):
    • Date
    • Thread