Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Cannot use Automator to Find Aperture Albums - just get errors

I've been trying to use Automator to automate the process of Exporting my Portfolio from Aperture to jpegs, then uploading these via FTP. However, whenever I try to use the automator actions "Choose Albums" and "Find Aperture Items" I get either errors or no items returned. I've eventually concluded that both the 'Choose Albums' and the 'Find Aperture Items' (with 'Albums' selected from the drop-down) can only find albums which are inside Projects, and cannot find albums which are not (i.e. are just in a folder).


For example, I am able to use Find Aperture Items (but not Choose Albums, incidentally) to find an album called 'Landscapes' which is inside a PROJECT called 'Portfolio', but not able to find an album called 'Landscapes' which is inside a FOLDER called 'Portfolio'. (Note the folder is not inside anything else, just under the Library heading in the inspector).


Since I store my portfolio as a set of albums inside a folder, and do not want to store it as Projects inside a folder (as this would require the photos to be moved to that project, rather than residing in their original project and having a reference to them in the album), can you suggest any way that I can use Automator to find these albums which are not inside folders and hence export my versions?


I should mention that when I try to use Choose Albums to find anything I get error messages, and when I try to use Find Aperture Items to find albums which are not inside projects I simply get no results.


Also, I'm running Automator 2.2.2, Aperture 3.2.3 and Lion 10.7.3.


Thanks 🙂

MacBook, Mac OS X (10.7.3), 2.4GHz Core 2 Duo, 6GB, 128GB SSD

Posted on May 9, 2012 11:42 AM

Reply
Question marked as Best reply

Posted on May 9, 2012 12:03 PM

The automator behaviour really seems to be buggy.

One problem I found since your last post here (Automator action 'Choose Project/Album' do NOT work) is, that filenames, version names, album names, or folder names containing non-alphanumerical characters are a big problem. Any character that has a special meaning to the underlying Unix shell, i.e."/" or parenthesis, may cause error messages or prevent the project or album from being found. Do your album name or project names contain any non-alphnumerical characters, for example date-strings with slashes?


I don't think you will be able to create robust Automator scripts based solely on the Aperture actions. To search folders and projects it might help to use "Run AppleScript" actions and to program the selection of albums, following patterns like this:


on run {input, parameters}


tell application "Aperture"

activate

tell library 1

set currentLibrary to name

set allAlbums to get name of every album

-- do something with the list of all albums ..

end run


Regards

Léonie

3 replies
Question marked as Best reply

May 9, 2012 12:03 PM in response to timjrye

The automator behaviour really seems to be buggy.

One problem I found since your last post here (Automator action 'Choose Project/Album' do NOT work) is, that filenames, version names, album names, or folder names containing non-alphanumerical characters are a big problem. Any character that has a special meaning to the underlying Unix shell, i.e."/" or parenthesis, may cause error messages or prevent the project or album from being found. Do your album name or project names contain any non-alphnumerical characters, for example date-strings with slashes?


I don't think you will be able to create robust Automator scripts based solely on the Aperture actions. To search folders and projects it might help to use "Run AppleScript" actions and to program the selection of albums, following patterns like this:


on run {input, parameters}


tell application "Aperture"

activate

tell library 1

set currentLibrary to name

set allAlbums to get name of every album

-- do something with the list of all albums ..

end run


Regards

Léonie

May 10, 2012 5:27 AM in response to léonie

Thanks for your help Léonie. As you suggested, AppleScript seems to be the way to go, so I learnt to use it and came up with the following...


set rootExportFolder to "path:to:export:location"

set albumNames to {"Foo", "Bar", "Etc"}

set exportFolderNames to {"foo", "bar", "etc"}


with timeout of (30 * 60) seconds

tell application "Aperture"

launch


set fileNamingPolicy to file naming policy "Index only"

set exportLargeSetting to export setting "Web Large"

set exportThumbSetting to export setting "Web Thumb"


repeat with i from 1 to count albumNames


set albumName to albumNames's itemi


set allImages to get every image version in album albumName of library 1


set exportFolder to rootExportFolder & ":" & {exportFolderNames's itemi}

set exportThumbsFolder to exportFolder & ":thumbs"


exportallImagestoexportFolderusingexportLargeSettingnaming files withfileNamingPolicy


exportallImagestoexportThumbsFolderusingexportThumbSettingnaming files withfileNamingPolicy


end repeat


end tell


end timeout


A quick rundown from the top:

  • First I set some variables. The path to the place where I want my portfolio exported, and the names of each of the Albums my portfolio is sorted into plus the folder name for each album.
  • Next I set a timeout - this is required because Apple Events time out after two minutes by default, so when exporting a large number of versions the script would time out and fail. So I set the timeout to 30 minutes instead.
  • Next I launch Aperture (in the background) and select my file naming policy and version export settings. These are selected from those that I have set up in Aperture.
  • Then for each of the Albums specified earlier, I get the contents of the album and export it, using Aperture's 'export' AppleScript command. For my purpose, I export both a large version and a thumbnail sized version. The thumbnails go in a folder which is in the folder where the full sized versions go.
  • That's about it. My actual script contains a bit of extra code to only export versions with Green colour labels, but that's just specific to how I have my library set up, so I haven't included it here.


Hope that's useful to anyone else who wants to export their Albums to folders!

Cannot use Automator to Find Aperture Albums - just get errors

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