Applescript to export single iPhoto album

I'm looking for a script that will allow me to export a single iPhoto album. I'd like to be able to automate it (eg. once daily). The name of the album never changes, but the content will.


I've found a few starting points, but nothing I've been able to wrap my head around. Most seem to require an actual input as opposed to a defined album.


Any help?


yeti

MacBook Pro (13-inch Mid 2012), OS X Mavericks (10.9)

Posted on Jan 8, 2014 8:20 PM

Reply
7 replies

Jan 8, 2014 9:07 PM in response to yeetboy

It doesn't look like there's any direct AppleScript support for exporting an album, so you're down to UI scripting to do it.


Given that your album choice is consistent you can just start off with:


tell application "iPhoto"

select album "My Super Awesome Album"

end tell


followed by the UI commands to export your album. Unfortunately I suck at UI scripting (i loath it) so can't provide much more context, but maybe you have the necessary incantations in your existing scripts.

Jan 9, 2014 8:07 AM in response to yeetboy

Depending of what you mean by “exporting an album”, the following script might do what you are asking for.


set theDestinationFolder to POSIX file "/Users/user name/some folder" as alias


tell application "iPhoto"

settheImagePathstoimage pathofphotosofalbum "My Super Awesome Album"

end tell


repeat with thisPath in theImagePaths

set thisFile to POSIX file thisPath as alias

tell application "Finder" to duplicate thisFile to theDestinationFolder with replacing

end repeat



Message was edited by: Pierre L. (no need to select the album)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Applescript to export single iPhoto album

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.