You are here

1 post / 0 new
Open Photos/Videos In Flickr Uploadr #1
Peter's picture
by Peter
December 17, 2013 - 7:59pm

Hi all, I just created my first Aperture AppleScript, and I’m proud to say it works, thanks in no small part to reading through the forum here. Thanks, everyone!

The script opens selected Aperture photos/videos into Flickr Uploadr. I’m finding this useful as a way to upload videos from Aperture to Flickr (which can’t be done using FlickrExport). Alas, uploading is not entirely automated, as Flickr Uploadr has no AppleScript dictionary, but at least this script will have Flickr Uploadr ready to go with the batch you select.

Sure, it’s not the most advanced script, but I figured I’d post it here to 1) share it, and 2) ask if anyone has any tips on improving it in any way. Thanks for reading!

Cheers,

Peter

 

Here’s the script:

 

– This script will open selected Aperture photos/videos in Flickr Uploadr (They will be placed in the batch to be uploaded. You will still need to set titles, tags, etc. manually in Flickr Uploadr.)

 

NOTE: Folder scratchFolder may be safely deleted after the files are uploaded (or if you decide not to upload the files after all).

 

ALSO NOTE: Running this script will delete all the files in scratchFolder. So do not run it while files are being uploaded from the folder!

 

– Written by Peter Dutton, December 17, 2013

 

set scratchFolder to “Aperture Scratch Folder”

tell application “Aperture”

   set imagesSelected to (get selection)

    if imagesSelected is not {} then – Only do the following if items are selected!

        

        – CREATE APERTURE SCRATCH FOLDER AND MAKE SURE IT IS EMPTY

        tell application “Finder”

            set desktopPath to path to desktop

            if not (exists folder scratchFolder of folder desktopPath) then

                make new folder at desktopPath with properties {name:scratchFolder}

            end if

            set fullScratchPath to folder scratchFolder of folder desktopPath as alias

            delete entire contents of fullScratchPath

        end tell

        

        – EXPORT SELECTED IMAGES TO APERTURE SCRATCH FOLDER

        export imagesSelected to fullScratchPath

        

        – OPEN THEM IN FLICKR UPLOADR

        – (Note: tried to replace “Flickr Uploadr” with a variable, but failed)

        tell application “Flickr Uploadr” to launch – if not launched before trying to open files, we get errors

        tell application “Finder”

            set filesToUpload to files of fullScratchPath as alias list

            tell application “Flickr Uploadr” to open filesToUpload

        end tell

        

    end if

    

end tell

 

 

 

You may login with either your assigned username or your e-mail address.
Passwords are case-sensitive - Forgot your password?
randomness