Applescript in aperture

I am having trouble writing a script to import photos into a new project in aperture. I know this can be done via automator, but need to do this with a script.
my main problem is creating a new project. I can get applescript to import into an existing project, but can't seem to create a new project no matter what syntax i use
any help is appreciated
thanks

This should do the trick for you:
<pre>
tell application "Aperture"
tell library 1
set theProject to make new project with properties {name:"New Project"}
end tell
import (list of photos) into theProject
end tell
</pre>
Quad G5   Mac OS X (10.4.7)  

Similar Messages

  • Applescript and Aperture - examples etc?

    I've programmed a lot, but not in Applescript. Does anybody know of a good, diverse collection of Applescripts for Aperture? The actions available in Automator don't handle what I need.
    (One script I want: I'm still trying to find a decent way to coordinate Aperture libraries on the big-screen iMac at home and the MBP I carry back and forth to work and into the field. It would help to have an automatic flag reminding me whether I had changed the library, or a project, on one machine, and therefore need to go through the long process of export/import. [I can remember, but I can also forget!])
    If I had some examples, I think I could figure out how to do this and other tasks. The Google hits I get focus on Automator, which doesn't have a wide enough variety of low-level actions to be very useful.
    Any pointers much appreciated.

    Oh well hey, of course I do -- a straight computer-to-computer Ethernet cable seems to provide about 11Mbps, at least ten times faster than Airport.
    That makes my question even more eager: Do you have (does anyone have) a sample command-line for using rsync to synchronize two Aperture libraries?
    As I understand it, the idea would be a quick way to update one library from the other -- NOT to meld competing sets of edits. Right? But it should be quick, because of rsync's ability to detect and transfer (inside the library's package) only changed items. Is that right?
    Is anybody using this?

  • How to make new project in existing folder with applescript in Aperture?

    I want to create a new project in an existing folder. I've scoured the web for answers to this but I cant find any. The closest I've come is this:
    tell application "Aperture"
    set imgSel to (get selection)
    if imgSel is {} then
    error "Please select an image."
    else
    set pName to name of parent of item 1 of imgSel
    set pID to id of parent of item 1 of imgSel
    set cID to id of parent of parent of item 1 of imgSel
    set cName to name of parent of parent of item 1 of imgSel
    set cLoc to folder cName
    tell library "Aperture Library"
    make new project at cLoc with properties {name:pName}
    repeat with i from 1 to count of imgSel
    move item i of imgSel to project (pName)
    end repeat
    end tell
    end if
    cLoc
    end tell
    Which returns:
    error "Aperture got an error: AppleEvent handler failed." number -10000
    Can anyone enlighten me as to what I'm doing wrong here or show me another way to achieve my goal, thanks?

    when you say 'new project in an existing folder'..... I assume you mean to create a new Project inside of an existing "Blue" folder...?
    Easy.... Select (click) the Blue folder you wish a new Project to appear inside > At the top left corner where it says "new" click the drop down arrow and select the project icon and click it.
    Easier still > select the Blue folder you wish another Project to appear inside > use 'Command & N' on the keypad and away you go...
    If you dont mean the above...? and you want a blue folder inside a blue folder..?
    To create a new blue folder use either the 'New' icon again at the top of the library inspector and click the blue folder icon or (Shift & Command & N ) on the keypad. Then select the new blue folder and repeat the process again...... A folder inside a folder..
    Couldn't be simpler....
    Aperture already provides these simple commands.... I cant imagine why you want to write an 'Applescript Action' for it.... Unless just for the heck of it...??
    Regards..... Gerry...

  • How Do I Run AppleScripts In Aperture?

    I want to copy the Version Name to the Object Name field without having to manually type it for each image...
    Here is the script I am attempting to run:
    tell application "Aperture"
    set selectedImages to the selection
    repeat with i in selectedImages
    set tName to name of i
    set value of IPTC tag "ObjectName" of i to tName
    end repeat
    end tell
    (I copied the script from this thread: http://discussions.apple.com/thread.jspa?messageID=4458642.)
    I enabled the Script Menu to appear in the Finder Menu Bar, but that is as far as I have been able to get. I tried selecting a couple of images in Aperture, then selected Batch Change/IPTC Basic. I then selected the script in the Script Menu and clicked "OK." Nothing appears to get transferred in the two selected image files metadata. I also tried running the script without going to Batch Change and Still No Go...
    I think that my problem has to do with this step from the linked thread, but I am unclear as to what it means:
    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.
    I have been through the Aperture Manual, Apple Aperture Digital Workflow book, etc. but I have been unable to figure out how to make this work.
    Message was edited by: MisterMojo
    Message was edited by: MisterMojo

    Since you have OS 10.5.8, do you also use an older Aperture version? Most people have latest OS and Aperture, so you might get more answers if we knew what your version of Aperture is...
    Well, I am running OS 10.6.2 and Aperture 2.1.4
    I found the script you posted to be non-functional. After digging around and some Googling, I came up with the following script that works for me. Keep in mind you are using a different OS version, but my point is, with some research and trial&err you should be able to do the same. I don't know anything about scripting, all I did was read into its meaning and substitute some terms. I basically stole the code and changed a couple of variables...
    tell application "Aperture"
    copy selection to theSel
    repeat with theImg in theSel
    tell theImg
    set MyVersionName to (get value of other tag "VersionName" of theImg)
    make new IPTC tag with properties {name:"ObjectName", value:MyVersionName}
    end tell
    end repeat
    end tell
    Notice how the script temporarily (?) creates a variable called MyVersionName, as a place to hold the value copied over from VersionName. Apparently scripts ignore the spaces in field names. It then uses the value from MyVersionName to fill in the ObjectName. The script is set to repeat for each image selected, one by one. I don't know why it's written like that, but it works.
    The above script works for both single and multiple selections of images. Pase it into AppleScript Editor, run it, save it in the Aperture folder which is a straight shot from the Save As... menu in the AppleScript Editor. (Users> {you}> Library> Scripts> Applications> Aperture)
    In the ASEditor's Preferences, make sure to check boxes so the scripts appear in the menu bar. Close the Editor. Back to Aperture, your (appropriately-named) script should show up from a drop-down at the menu bar under the AppleScript icon. Test it on a couple of inages. Mine works.

  • Applescript for Aperture

    After uploading to Facebook from Aperture, then editing the captions in FB I, like several others it seems, have found that these new captions get used by Aperture as the Version Name for the photos, so I now have photos with Version Names like "A cold, misty day" etc.
    I now want to fix these so the VNs are the same as the Master Filenames (without the extension) and figure an AppleScript is the way to go.
    I'm sure that if I read the manual I could write this myself, but just wondering if anyone else has already done it, or knows of a script somewhere?
    <Edited by Host>

    hilofoz wrote:
    Well, it maps perfectly with title and caption from Lightroom, as I may have mentioned. The version name is derived from the master name, which in my case are numerical dates. Not very interesting. Neither can you name those versions with the same name if exporting to Flickr.
    Flickr accepts the headline if IPTC metadata is shown as a preference. I have just tested FlickrExport and the choice is there, and therefore works the way I want it to, using the headline data for a title. The filename (which becomes the version name) is not the most desirable name for a title.
    Alright, I did not know of the 'headline' and 'caption' keywords. Those would possibly make more sense indeed...

  • Who Uses Applescript with Aperture and Why?

    From time to time, I come see Applescript mentioned by Aperture Users. The Apple Support website devotes a few paragraphs.
    For an amateur with lots of time. how would Applescript make my experience with Aperture any better? It automates what?

    http://www.apple.com/aperture/resources/pdf/Aperture_3_AppleScript_Reference.pdf
    http://apertureexpert.squarespace.com/forum-applescript/
    http://www.macosxautomation.com/applescript/aperture/publish/index.html
    http://www.macworld.com/article/2033806/import-like-a-pro-in-aperture.html
    There's also an application that will give you lots of statistics on your Aperture library (lenses used, etc):
    http://www.apertureexpert.com/inspector
    I'm pretty sure it uses AppleScript to get the data.

  • Applescript and Aperture

    Unlike all of the other questions I've been able to find regarding Aperture and Applescript, I'm not (yet) interested in scripting export. I'm trying to do some import functions.
    Specifically, I have a hierarchical filesystem setup that I'd like to mimic in Aperture. I can recursively examine the filesystem, but I haven't found a way to create folders/subfolders in Aperture (I can't use Projects, because my filesystem hierarchy has more than 20,000 pictures in it). The idea is that I'll have nested subfolders in Aperture, with the leaf nodes being projects containing my pictures.
    It's likely that my current scheme is less than ideal (the folder structure should probably be converted to tags instead), but I want to use Aperture to help me impose a new scheme.
    In any case, every variant I've tried on "create subfolder ..." has failed, but the error messages are cryptic. I was hoping there was a reference somewhere that my Googling has missed. I welcome any advice (even if it's "You can't/shouldn't do that!")
    Thanks!

    I'm wondering why you would need Applescript at all - unless i'm not understanding correctly. Can't you use the "Import - Folders into a Project" ?
    This is from page 111 of the manual:
    If you’ve spent time organizing your images into a meaningful hierarchy on your
    computer and you want to keep that organization, you can import a folder of images
    as a project or drag it directly into the Projects panel. When you import a folder of
    images or drag it into the Projects panel, the folder becomes a project and any
    subfolders become albums within the project.
    And
    When importing folders of images into Aperture, carefully plan how you
    want your images organized before you begin. The top-level folder containing images
    becomes a project containing all the images in the subfolders as well. This means that
    if you import a folder with thousands of images contained within its subfolders,
    Aperture will create a project with thousands of images. You can import a maximum
    of 10,000 master images into a project. If you have over 10,000 images to import into
    Aperture, consider importing the subfolders individually instead. Each subfolder will
    then become its own project.
    Wouldn't this work?

  • Aperture and Applescript

    The excellent Tidbitshttp://db.tidbits.com/issue/918 had a link a set of nice demos showing the use of Applescript with Aperture, in this case linking to Adobe CS3 InDesign: http://www.apple.com/applescript/aperture/indesign/
    This suite of tools is at least a partial answer to my earlier complaints that there were no easy ways to alter the default web templates built into Aperture 2.X.
    I wish this kind of stuff was cross-linked somehow to the Aperture forum...

    http://www.apple.com/aperture/resources/pdf/Aperture_3_AppleScript_Reference.pdf
    http://apertureexpert.squarespace.com/forum-applescript/
    http://www.macosxautomation.com/applescript/aperture/publish/index.html
    http://www.macworld.com/article/2033806/import-like-a-pro-in-aperture.html
    There's also an application that will give you lots of statistics on your Aperture library (lenses used, etc):
    http://www.apertureexpert.com/inspector
    I'm pretty sure it uses AppleScript to get the data.

  • AppleScript & Aperture lacking tutorials?

    I've been researching AppleScripts for Aperture.
    I've found a number of resources (www.apple.com/applescript/aperture/, John Larson, Brett Gross, and ever helpful Ian Wood and his Aperture Assistant).
    It seems there is a lack of documentation and assistance from Apple (including limited abilities of Automator for Aperture). Do others think this is true?

    http://www.apple.com/aperture/tutorials/ (from Apple)
    http://www.apple.com/applescript/aperture/ (from Apple) (which you referenced)
    http://www.apertureprofessional.com/ (great third party site)
    http://automator.us/leopard/aperture/
    

  • ILife Like Aperture Backups?

    I have been searching the forums here and elsewhere to get a good answer to the DVD backup issue.
    Is there a DVD backup process like iPhoto for Aperture (i.e. it backs up to a DVD, and when you insert the DVD you get a read-only copy in the interface... in iPhoto it works VERY well).
    The only two options I see are having individual project "packages" through the "Export Project" function... and save them to DVD... or of course the direct Vault to DVD option should the vault be small enough.
    I just dont know of any 3rd party options to make this a bit nicer... and I am sure it will still be a long while before Apple understand and implements a solution.

    Been requested as a new function. It ca be done through Automator and Applescript as Aperture is very open to these tools, but it's not baked in. We'd like it to parse across several DVD's (fit to DVD then o to next vs. spanning any individual file) and an indexing function similar to reference images on import.

  • Aperture backups

    What is the best way to keep back ups of thousands of pictures in external hard drivers used in several computers

    Been requested as a new function. It ca be done through Automator and Applescript as Aperture is very open to these tools, but it's not baked in. We'd like it to parse across several DVD's (fit to DVD then o to next vs. spanning any individual file) and an indexing function similar to reference images on import.

  • AppleScript freezes in editor but works in script menu.

    Hi guys.
    I've run into a weird problem while writing a simple AppleScript for Aperture. It works fine if I save it and run it from the script menu, but if I run it from Script Editor, all I get is a spinning beach-ball. How is this possible? This is the part of the script that makes it hang:
    tell app "Aperture"
    set sel_ to (get every image version of library 1)
    set list_ to {}
    repeat with i from 1 to (count sel_)
    tell (item i of sel_)
    if (get value of exif tag "CaptureYear") is 2010 then
    set end of list_ to (item i of sel_)
    end if
    end tell
    end repeat
    end tell
    Does anybody have an idea why this works in the script menu but not in the editor?
    Thanks,
    Morten

    Sorry, I should have posted this in the AppleScript forum.
    Morten

  • 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

  • Set Caption as File Name?

    Sometimes people send me photos I want in my library, and those images are named with a string of text that would be a suitable caption. I've got a fair number of these images now, and I'd like to know if there is a batch way of changing the caption on those images from being blank to the file name.
    In other words, if I have a bunch of files named "1973 Summer Trip to Las Vegas.jpg", etc., but with no metadata (blank caption, etc.), is there a way to automatically set the captions as the names of the file? I know that it is trivial to rename the file or version, and I'll do that once I've saved the present file name into the caption field.
    Many thanks in advance for you help.

    "tImg" is just a variable holding an image version id. You'll note that it shows up coloured green in Script Editor like other variables.
    "tCap" in that script is a variable used to hold the value we want to put into the caption. So we set it to the name and then set the caption to it.
    A good starting point for getting the AppleScript names of different tags is:
    tell application "Aperture"
    set selectedImages to the selection
    get every IPTC tag of item 1 of selectedImages
    end tell
    Replace 'IPTC' with 'EXIF' to get a list of EXIF tag names, with 'custom' for your own tags you've added plus the timezone names, and 'other' for some other stuff like filename, pixel sizes, main rating etc. Note that in all cases the script will only list the names for tags that apply to the image - so an image with no IPTC data will return no tag names.
    A couple of good places to get started with AppleScript and Aperture:
    http://homepage.mac.com/jlarson7/news/index.html
    http://brettgrossphotography.com/category/mac/applescript
    Ian

  • Keyword Woes

    If I apply a keyword to an image from the HUD and then adjust the HUD, the image tag remains the same.
    How does everyone feel about this? I think that the keyword should "stick" to what is reflected in the HUD. This seems like a problem to me.
    Also, is there any way to get all my keywords in the HUD? I hate when they are orphaned with the images and gone from my HUD.
    Sigh.

    I've already sent a feedback to Apple regarding this.
    Personally, I believe the keywords should be tracked by ID. Apparently though, they're not because you can change the keywords in either the HUD or the Keyword Inspector and the changes are not seen in the images or in the Keyword Control Sets.
    Funny thing: the AppleScript for Aperture indicates that the keywords already have IDs. it's just that Aperture isn't using them.
    The example I gave Apple was; if I had a keyword 'dad' and decided to change it later to 'father'. I would now have some images with the keyword 'dad' and some with the keyword 'father'. I would prefer that Apple uses the IDs to track the keywords and update them accordingly. when exporting the images, the keyword text itself would be exported rather than the IDs.
    Apple may be afraid that the average person would change keywords in the HUD not realising that every image in the database would reflect the change. So for example, someone has images with the keyword "Elephant" but they don't think they'll have any more elephant images to process. at the same time, they expect to have Monkey images coming. to save time, rather than delete "Elephant" first, they simply double-click "Elephant" and change it to "Monkey". The result would be that every Elephant image in their collection would now be keyworded as Monkey.
    Apple must have thought hard about this but I would really have preferred an ID-based system. One option would be to use one of the Keyword interfaces to make changes to the keywords where that interface would be ID-based. All other interfaces would be text based. People wanting ID-based systems would use that interface while other people could use the other interfaces.
    From time to time, I'll rethink my keywording system and hierarchy. Unfortunately, it could really mess up the organisation of my library unless I'm careful. I'll just have to remember the Smart Album method of replacing Keywords and also remember that I now have a script to delete/create keywords.

Maybe you are looking for

  • OK to copy a placed image from one document to another?

    Hi all, I'm laying out two language versions of an illustrated book. Because they're going to be printed with the same CMY plates (with just the black plates being switched between the languages), the color images need to be in exactly the same place

  • UDF for Item Master Data

    Hi, The UDF options in the menu bar for the Item Master Data are available in one database but NOT in another database. Is this a known bug and/or related to conversion of a database from a previous version. We're using SBO 6.5 SP:01 EF:07 Thanks

  • Lightroom 5.7. How to create custom color labels.

    I would like to create custom color labels. I have created names for five colors, but the "custom" color (white) does not appear to be customisable Any ideas? Ideally I would like two more color labels.

  • SAP BO Reports installation

    Hi All, What are tools i need to install to develop and deploy the SAP BO Reports? Please clarify with and tools with functionality Thanks Sivs

  • Norton AntiVirus 11, Time Machine, and Time Capsule

    When Time Machine starts Norton AntiVirus begins a scan of all 700k+ files on my Time Capsule. I cancel the scan but wonder if I am doing the right thing?