2 Replies Latest reply: Feb 2, 2012 5:24 AM by Koen van Dijken
Koen van Dijken Level 1 Level 1 (15 points)

Hi Forum,

 

I started to write an AppleScript for Aperture to perform a backup. The standard backup procedures of Aperture are not quite right for me so I decided to write my own using AppleScript.

 

One question which arised was how I can supppress the dialog box which Aperture opens when an export could not be done because of a missing master. I want to suppress the dialog box and instead get an error returned from Aperture into AppleScript. is that possible?

 

Koen van Dijken

  • léonie Level 9 Level 9 (68,485 points)

    Hello Koen,

    have you solved your problem by now? For me the following does work:

     

    I does not seem to be possible to set Aperture to suppress the warning, so catching the error in a "try" clause will not help. The best option is to check, if the master image is online, before trying to export and skipping the offline images, like in this example,  see: http:/dreschler-fischer.de/scripts/ExportMastersWithoutWarning.scpt.zip

     

    on run {}

      -- export masters, but check it they are online before trying to export

      -- skip if not online

              set exportFolder to (choose folder with prompt "Choose an export folder")

     

              tell application "Aperture"

                        set imageSel to (get selection)

                        if imageSel is {} then

                                  error "Please select an image."

                        else

                                  repeat with i from 1 to count of imageSel

                                            try

                                                      set onlne to get online of (item i of imageSel)

                                                      if onlne then export {item i of imageSel} naming folders with folder naming policy ¬

                                                                "Project Name" to exportFolder

                                            end try

                                  end repeat

                                  return imageSel

                        end if

              end tell

    end run

     

    Regards

    Léonie


  • Koen van Dijken Level 1 Level 1 (15 points)

    Thanks for your answer Leonie. I'm glad you came up with the same idea as I did in case suppressing the dialogbox was impossible. I implemented this and it works fine.

     

    Koen