BASICS


Note: The scripts on this site are provided as is and I am unable to provide any technical assistance. Backup all data before using any script provided by this website.

eight="32" class="edit-image" alt="Click to open example in the Script Editor application">Reveal information about an Applescript object by asking for its properties.

 
tell application "Aperture"
  get properties
 end tell


Of course the available properties for an object can also be found in the application's AppleScript dictionary as well.

Below are three very basic scripts that give you an idea how to create projects, folders, and albums. New to Aperture 2.0 is the ability to create subfolders (aka yellow folders). Use the examples below as well as the AppleScript dictionary to figure out how to create subfolders.

Click to open example in the Script Editor applicationCreate Projects.

 
tell application "Aperture"
  tell library 1
  make new project with properties {name:"new_project"}
  end tell
 end tell



Click to open example in the Script Editor applicationCreate Folders.

 tell application "Aperture"
  tell library 1
  make new folder with properties {name:"new_folder"}
  end tell
 end tell



Click to open example in the Script Editor applicationCreate albums (only the ordinary albums, not the more specialized albums such as the light table).

 tell application "Aperture"
  tell library 1
  make new album with properties {name:"new_album"}
  end tell
 end tell


Say you want to get the names of all of your projects or maybe the names of all of your images within a particular project.

Click to open example in the Script Editor applicationGet the name of every project.

 tell application "Aperture"
  tell library 1
  get name of every project
  end tell
 end tell


Rather than process every image version within a project, you may want to process only those selected in a project. Using the selection property of the application class, you can obtain a list of currently selected image versions. Be sure to refer to Aperture's AppleScript Dictionary for more information.

Click to open example in the Script Editor applicationGet a list of selected image versions.

 tell application "Aperture"
  set imageSel to selection
 end tell