Scripting Aperture

Hi,
Thought I asked here as not to many folk in the Aperture list are doing scripting on the app.
I am trying to figure out how to tell what type an Album is. An Album in Aperture can be one of a number of different containers.
Here's the dictionary definition:
album n \[inh. container\] : This class represents an album, smart album, light table, web gallery, web journal, or book within an Aperture library.
I've tried getting the properties of the Album but that didn't show any differences between the various types of Albums, the class for all was just Album.
So any ideas where I might try looking?
Thanks

Indeed, the album definition does seem to omit any reference to the type of album.
If the dictionary doesn't reveal anything, there isn't much you can do about it, other than appeal to a higher authority.

Similar Messages

  • Scripting Aperture albums

    How does one use scripting in Aperture? Any good examples anywhere for dealing with projects, albums, versions, etc.?
    Specifically, I'm trying to display a list of albums but it's not working. I can list the projects without any problems. Here's the applescript:
    tell application "Aperture"
    activate
    set myProjects to name of every project
    set selectedProj to choose from list of myProjects
    display dialog "# of Albums: " & (count of every album in selectedProj)
    display dialog "# of Albums: " & (count of every album)
    end tell
    It always returns 0. Anyone get this kind of thing to work? Thanks.
    Power Mac G5, Dual 2GHz, 3.5GB ram, X800 XT   Mac OS X (10.4.5)   iBook G3 800 MHz, 640 MB, ComboDrive

    display dialog "Albums: " & (count of albums of project (selectedProj as string))
    Power Mac G5, Dual 2GHz, 3.5GB ram, X800 XT   Mac OS X (10.4.5)   iBook G3 800 MHz, 640 MB, ComboDrive

  • Running scripts in Aperture

    Aperture appears to have the facility to run scripts during the import stage (it's called 'Action' in the import pop up menu), but I'm having problems with it.
    I have successfully run the script below, and have exported the subsequent metadata to the master, which is my aim.
    But I cannot get the script run via this 'Actions' facility during import, even importing into a second library after the 'Object Name' field (called 'Title' by Aperture) has been created in the file and contains a 'space'.
    Can anyone show me what I am doing wrong?
    I found the script at: How can I set the Object Name to the file name on import?
    The post reads:
    AppleScript to the rescue!
    1. Copy the following text into Script Editor:
    tell application "Aperture"
    set selectedImages to the selection
    set tName to name of item 1 of selectedImages
    repeat with i from 1 to number of items in selectedImages
    set this_item to item i of selectedImages
    set tName to name of this_item
    set value of IPTC tag "ObjectName" of this_item to tName
    end repeat
    end tell
    2. Save the script in a sensible place, such as ~/Library/Scripts/Aperture Scripts so that it will turn up in the Script Menu (if it's enabled).
    3. Select a bunch of images in Aperture.
    4. IMPORTANT! You must use Batch Change to put a value into the Object Name tag (such as " "), until you do so the tag doesn't exist for those images and therefore cannot be altered.
    5. Run the AppleScript, it should loop through all the selected versions and put the version name into the Object Name tag.
    Note - the Master File Name isn't accessible via AppleScript, only the Version Name.
    Ian
    P.S. As with all such scripts, test it on a small number of 'spare' versions before doing anything drastic...
    Help!

    I haven't. Have you tried making a droplet to run at the end of the LR export?

  • Scripting in Aperture?

    As a newbie AppleScript novice I wonder if anyone can point me in the right direction for helpful sites on scripting Aperture please? I looked at a previous post from 2008 and the sites mentioned there do not seem to be available now.
    Many thanks.

    answered here http://discussions.apple.com/thread.jspa?threadID=698533&tstart=0

  • Automating album creation for a new project?

    I have several projects (such as specific event shoots) with the same basic set of albums for that project (some regular albums, some smart albums). I'll have albums for specific subsets of the events (for my sports shots, there's Individuals, Action, Team, etc.).
    I'd like to automate the creation of these albums, as it gets a bit tedious having to create a bunch of albums manually for each new project I create. I looked at Aperture's automator actions, but couldn't find anything related to album creation. Is there such a thing?
    Thanks...
    David

    I'm pretty sure this is scriptable using AppleScript. I haven't really had the need to script Aperture so I can't tell you the exact syntax without looking it up myself, but it shouldn't be too hard if you've ever used AppleScript. Just open Script Editor, go to File > Open Dictionary... > Aperture and you'll get a list of the scriptable actions Aperture has available.

  • Aperture Script - Can't replicate problem

    I wrote this script to rename and File Aperture projects by date : http://www.johneday.com/9/rename-and-file-aperture-projects-by-date .
    A Mountain Lion user has given me this feedback:
    OK, so I get the error that the EXIF tag does not have capture year. I'm on Mountain Lion, and recall that it worked on one project the very first time I ran the script after downloading and installing it... it's almost as if some flag gets set to true or false and it needs to be reset.
    Can anyone running Mountain Lion replicate this problem for me? Any insights about what is going wrong for him would be appreciated.
    set yourFolder to "Imported by Date" -- Name your folder here
    set appendParent to false -- If true, the selected parent's name will be appended to the new project name
    set makeSubfolders to false -- If true, new projects will be created in year/month/ folders.
    property delimiter : "-"
    try
        tell application "Aperture"
            activate
            -- Wait until Aperture is finished processing other tasks
            repeat
                set taskCount to count of tasks
                if taskCount is 1 then
                    display alert "Aperture is processing another task" message "Please wait for the task to complete and try again" buttons {"Try again", "Cancel"} default button {"Try again"} cancel button {"Cancel"}
                else if taskCount > 1 then
                    display alert "Aperture is processing " & taskCount & " tasks" message "Please wait for the tasks to complete and try again" buttons {"Try again", "Cancel"} default button {"Try again"} cancel button {"Cancel"}
                else
                    exit repeat
                end if
            end repeat
            -- Verify that at least one item is selected
            if selection is {} then display alert "The selection {} is empty" message "Please select ONE Project, Folder or Album from the Library tab in the sidebar and try again." buttons {"OK"} cancel button {"OK"}
            -- Get the selected Parent ID
            tell item 1 of (selection as list) to set theParent to parent
            set {parentClass, parentName} to {class, name} of theParent
            if parentClass is album then display dialog "Albums may contain images from multiple projects. Are you sure you want to move these images from their projects?"
            -- Get date of every image in the selected Parent
            tell theParent to set dateList to every image version's (value of EXIF tag "ImageDate")
            tell library 1
                -- Create your folder if it does not exist
                if not (exists folder yourFolder) then make new folder with properties {name:yourFolder}
                -- Assign name of every project in your folder to a list for the Create project command below
                -- (exists project isoImageDate) command is too slow to be included in the loop
                if not makeSubfolders then tell folder yourFolder to set parentList to name of every project
                set dateTest to {}
                repeat with aDate in my dateList
                    -- Test each date to avoid processing duplicates
                    set shortDate to short date string of aDate
                    if dateTest does not contain shortDate then
                        set end of dateTest to shortDate
                        -- Convert the image date to YYYY-MM-DD format
                        set projectYear to year of aDate as string
                        set projectMonth to (month of aDate as integer) as string
                        if length of projectMonth is 1 then set projectMonth to "0" & projectMonth
                        set projectDay to (day of aDate as integer) as string
                        if length of projectDay is 1 then set projectDay to "0" & projectDay
                        set isoImageDate to projectYear & delimiter & projectMonth & delimiter & projectDay as string
                        if appendParent then set isoImageDate to isoImageDate & space & parentName
                        tell folder yourFolder
                            if makeSubfolders then
                                --Create year and month folders if year folder does not exist
                                if not (exists folder projectYear) then make new folder with properties {name:projectYear}
                                tell folder projectYear
                                    if not (exists folder projectMonth) then make new folder with properties {name:projectMonth}
                                end tell
                                --Create project if it does not exist
                                if ((name of every project of folder projectMonth of folder projectYear) does not contain isoImageDate) then tell folder projectMonth of folder projectYear to make new project with properties {name:isoImageDate}
                                -- Move the images into the project
                                move (every image version of theParent whose value of EXIF tag "CaptureYear" is year of aDate and value of EXIF tag "CaptureMonthOfYear" is month of aDate as integer and value of EXIF tag "CaptureDayOfMonth" is day of aDate) to project isoImageDate of folder projectMonth of folder projectYear
                            else -- If not makeSubfolders
                                --Create project if it does not exist
                                if parentList does not contain isoImageDate then make new project with properties {name:isoImageDate}
                                -- Move the images into the project
                                move (every image version of theParent whose value of EXIF tag "CaptureYear" is year of aDate and value of EXIF tag "CaptureMonthOfYear" is month of aDate as integer and value of EXIF tag "CaptureDayOfMonth" is day of aDate) to project isoImageDate
                            end if
                        end tell
                    end if
                end repeat
                -- Move the initial container to the Trash if no images remain or if it is an album           
                if parentClass is album then
                    delete theParent
                else if (count of image versions of theParent) is 0 then
                    delete theParent
                end if
                beep
            end tell
        end tell
    on error errMsg number errNum
        tell me
            activate
            display alert errMsg & return & return & "Error number" & errNum buttons "Cancel"
        end tell
    end try
    EXIF Tag Name Mapping
    The following table provides a mapping between EXIF tag names found in the Aperture 3 interface and EXIF tag names that appear in AppleScript.

    Well, the obvious answer to your question is that Aperture in not seeing a 'CaptureYear' EXIF tag on an image. The way you have your try block set up, that amounts to a fatal error in your script.  why it's not seeing a capture year is a different question.  you might try asking the user with the problem to log the EXIF names for the images s/he's working on:
    get name of every EXIF tag of image versions of theParent
    you might also try breaking the complex command down into two simpler commands, in case ML has introduced a race condition:
    set movables to get (image versions of theParent whose (value of EXIF tag "CaptureYear" is year of aDate) and (value of EXIF tag "CaptureMonthOfYear" is (month of aDate as integer)) and (value of EXIF tag "CaptureDayOfMonth" is day of aDate))
    move movables to project isoImageDate of folder projectMonth of folder projectYear
    Of course, it could just be goofy user error as well - trying to run the script on an empty album or somesuch.
    Sorry I can't test this myself; my copy of aperture is an expired demo I keep around so I have access to the scripting dictionary (aperture questions are common enough to make that worthwhile), so I can't actually use it for anything.

  • Aperture update and post script printers

    I downloaded the latest Apple update for raw cameras, ie 50D, and now when I move any image to photoshop to print, I get a pop-up saying my epson 2400 is not a post-script printer and all prints cone out very dark regardless of adjustments....any ideas. The printer/photoshop combo has worked perfectly up to this point.

    How are you moving your file from aperture to photoshop and in what format?
    Check that the export preset you are using from aperture has not been changed by update.
    Does the image look ok in photoshop before sending to printer? Does it look very different from same image in Aperture?
    Try printing direct from Aperture (if you need photoshop processing do it using photoshop as the external editor), Aperture can do very good prints.
    Try printing an image from photoshop that was exported from aperture before the update, if thats still bad then problem would appear to be with photoshop, if that print is good then problem probably lies between aperture/photoshop.
    What version of Photoshop do you use?
    Have you done any other updates to your system software in the same period?

  • Add all files of one folder to aperture by running a script

    HI,
    i have a question:
    I will make my Aperture Tethered more easy (with my Canon eos 30D) i have coded a script / folder action to do this but: this folder action does not import all pictures (wy ever, i think that the files coming in to fast were not recognized).
    Now i will code a script which will include all files of a folder to aperture when it is run.
    i will give it a try, and the import does function, but, i don't know how i can tell the script which files it should import (with a folder action its easy, with this line:
    on adding folder items to this_folder after receiving these_items
    but how to do this without the "on adding folder items" cause that does not happen in the case i will use it.
    i'm looking forward to anthers:D
    Best Regards
    Christoph

    yes i tryed this application, and there was the same problem as with my one (i have programmed my based on this application)
    but both had the same problem they open on imageadd, but if i take more images in seconds (i think the script is still running => it can't recognize new images) it does not recognize the newly taken images.
    and i hope some script that imports all images in the folder will solve the problem.
    the more ore less only problem is to tell the application which images to import (like: on run import ALL files)

  • How to import camera raw-files as DNG-files using AppleScript action in the Aperture's Import menu - does such a script exist?

    I'm looking for a smart way to set up an Aperture 3 workflow - where my propriatary camera raw files get converted into DNG-files when I import my files into Aperture. Aperture's Import menu allows for an Apple-Script to come into action as part of the Import settings. I was thinking if it would be possible for an AppleScript, as part of the import routine, to automatically send the files through the DNG converter app and back into Aperture? So that when the files were finally imported into Aperture they would be DNG-files?
    Greatful for any answers and ideas!

    Thanks for a swift reply Frank! I will have to use the Adobe DNG converter then, prior to importing into Aperture.
    Yes, OSX does support my Nikon D600 NEF-files. But once in a while I want to be able to use features found in other raw apps, within my overall Aperture workflow, but without ending with a TIFF or other 'destructable' file format when continuing my workflow back in Aperture. This should be possible using the routine described here: http://www.apertureexpert.com/tips/2013/8/28/guest-post-catapult-and-aperture-3. html
    In my case the problem is that my "old" CS5 version of Photoshop cannot be updated to read D600 files (even though CS5 is not even 3 years old) - I would have to buy a newer version of Photoshop and I have absolutely no intention of doing that. And so I have to find a raw file fomat that is readable by both apps.
    On a second note there is a discussion about what raw format is likely to 'live the longest'  - also be accessable in 20-30 years. Some say that DNG stand a better chance here than propriatary ones. But I don't know about that and that is not my issue here.

  • Scripting with Aperture to select images

    I am trying to create an Applescript and need a little help. It needs to read filenames from a text file and then select those images in Aperture and change their rating to 3 stars. I have the first part worked out, I think, but am having trouble getting the images selected from the list and their rating changed. Any ideas would be much appreciated.

    It's my script in the first place...
    The line you need to replace is:
    "duplicate tImgID to this_project"
    with:
    "set main rating of tImgID to 3"
    If the first part of the script is working, this should now set the rating to 3 instead of adding the Version to an Album.
    One of the best places to get some beginner's scripts for Aperture is http://homepage.mac.com/jlarson7/index.html
    Ian

  • Aperture 2, scripting and "HDR"

    Good morning,
    Unfortunately, I am not aware of an HDR plug-in for Aperture, and creating HDR photos is a bit of a hassle. I've been thinking about ways to make it a little easier. In this context, I recently read that one of the nice improvements of Aperture 2 is that it is scriptable. I have zero experience with scripting, but I am wondering whether the following would be possible:
    - Take a photo in Aperture, after it has been color-corrected, cropped etc. and make two new version of this photo, one with exposure set to +1 and one with exposure set to -1,
    - export all three into a folder,
    - delete the two version with exposures +1/-1.
    So essentially the idea is to export three different versions of a photo. These can then be used to generate an "HDR" picture (not a real HDR, since it would be based on a single photo, but for most purposes it would do). Right now I am doing this manually, but ideally, generating and exporting different versions would be done with a single click of a mouse or keyboard shortcut.
    Has anyone ever written such a script, or something similar (that I could take as starting point)?
    Many thanks,
    PM

    PMaier wrote:
    I recently read that one of the nice improvements of Aperture 2 is that it is scriptable.
    Aperture has always been scriptable. It's just that each version adds a few more scriptable features...
    - Take a photo in Aperture, after it has been color-corrected, cropped etc. and make two new version of this photo, one with exposure set to +1 and one with exposure set to -1,
    - export all three into a folder,
    - delete the two version with exposures +1/-1.
    Adjustments are one of the bits which aren't scriptable. Creating and deleting Versions isn't too easy, either.
    So essentially the idea is to export three different versions of a photo. These can then be used to generate an "HDR" picture (not a real HDR, since it would be based on a single photo, but for most purposes it would do). Right now I am doing this manually, but ideally, generating and exporting different versions would be done with a single click of a mouse or keyboard shortcut.
    To be honest, you won't get a lot out of this approach that you couldn't get from careful use of the Highlights & Shadows and levels adjustments. I know, I've been doing 'medium' DR imaging for 4-5 years now.
    Ian

  • Aperture script menu plugin won't save

    So I've created an Aperture workflow that extracts metadata, writes it to a text file and opens in excel for me. This workflow works as expected from within Aperture. The way it functions is to run the operation on Selected files from within Aperture so I want it to show up in the script menu but when I save it as a plug-in it doesn't show up in the menu.
    A grep of the entire disk shows no sign of the filename anywhere. What gives?

    No one has a single clue about this?

  • Xpress to indesign aperture integration script

    Hi, After using quark for so long, I came across an article that specified how to use the Leopard media browser to insert graphics from our Aperture library and swap out the previews for the high resolution originals at output using scripts.
    http://www.apertureprofessional.com/showthread.php?t=12703
    This function really got me, and I immediately downloaded the Indesign CS4 demo.
    My problem is that the links to the scripts coming from numerous websites that mention them all get redirected to Apple's Leopard feature set page and nowhere are they accessible.
    The articles are a bit dated and use cs3 for their examples. Are these functions built into cs4 and I just can't find them this early into my plunge to indesign? I've searched extensively for the past few days and are coming up empty. If it isn't possible, I might forego the learning curve for a little while longer and stay with Quark till I'm not so busy.
    I've told the pdf output not to compress anything, no success
    I created 96k low res previews of a file, imported it and when I package the layout the 96k file gets packaged, not then 9Mb original. no success
    All help would be appreciated
    Thanks

    So no one that uses indesign and Aperture integrate them?
    What suggestions do the pros have for my simple situation and not duplicate and have to track over 170 individually placed files per catalog.
    Usually update 3 catalogs per year

  • A script to identify pictures in the Finder not added to Aperture?

    Does anyone know of a script that can check out the contents of a folder containing a series of nested folders holding files that are being referenced in the Aperture Library and point out the files in that folder which have not been added to the Aperture Library?
    The majority of the files in that folder (thousands) are being actively referenced in my Aperture Library, but for whatever reason that I won't get into, a few hundred pictures that are in that folder somewhere have had their links to Aperture broken and it would be great if I could identify which files those were and hook them back up to Aperture.
    These are all pretty old pictures that I likely won't ever need to be touching ever again, so if the solution is going to be a massive re-doing of my Library, then it won't be worth it, but if it can be done relatively easily then, ya know…it'd be nice to have the Library be "perfect" and free from broken links

    Thanks for your reply.
    What you are suggesting is part of the process that I am using to reconnect these missing files.
    The part that I am needing help with is the "If you direct Aperture to the first of those missing masters" aspect.  There are so many pictures in my reference library location (all nester in folders, so I can't just use Coverflow to skim through them and find the missing file to reconnect) that it would be extremely time consuming for me identify the correct file.
    Even if I do a spotlight search for "DSC_00413" in that folder, I get back ~500 results.
    This is why I feel that the script option to consolidate all of those "unconnected to Aperture" files in one folder, where I can then use Coverflow to identify them would be most effective.
    EDIT: I manged to do it though, by using Aperture's "Relocate Masters" command to move all files linked to Aperture to another location, thus leaving all "unconnected" files in their current location

  • Scripting question: how to suppress Aperture dialog when exporting?

    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

    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

Maybe you are looking for