Getting Selected Project in Aperture using AppleScript

Is it possible to get a reference to the currently selected project in Aperture using AppleScript? In other words, is it possible to get the project containing the currently selected image (which I can get by using "selection")? If possible, how can I do it?

GIve this a try:
tell application "Aperture"
set x to selection
set x to item 1 of x
tell library 1
get value of other tag "MasterLocation" of x
end tell
end tell
One thing that helps to answer similar questions is to ask for properties of objects. That can reveal more about an object. Another way to help answer these kinds of questions is to ask for available tags in Exif, IPTC, and "other tags" of a particular image version. That will tell you all the available tags that have values assigned for a particular image version. You can then explore those tags to see if what you are looking for is available.
Hope that helps.
Message was edited by: lenny

Similar Messages

  • Get the project name to use in a procedure?

    How to get the project name to use in a procedure?
    example <% = odiRef.getOption ("COMPATIBLE")%> - but the project name or your id?
    in ODI 11.
    thanks
    Edited by: user ODI Dev on 01/12/2010 16:42

    I also need solution for this issue.
    I want to set ODI variable value in Jython script, this method described there: How to assign value for a ODI variable from Jython Script
    I need to update snp_var_data table. For more flexible solution i need to know project name where variable declared, because variable name in snm_var_data consist of two part <PROJECT_NAME>.<VAR_NAME>. Also this name convention don't changed after import scenarios from dev to execution repository
    Edited by: 822130 on 19.12.2010 4:31

  • Change selected file in automator using applescript ???

    So I'm getting better at using Automator to create useful Services but still a bit of a newbie with doing powerful things with AppleScript... and I think this task requires some applescripting. Here's what I want to do:
    1. Based on a selected text file I want to run a pre-existing script that converts this file into an HTML file. This new file has the same name as the text file but has the .html extension rather than the .txt extension. (This step is easy enough with Automator and it works just fine already.)
    2. BUT NOW, I want to take that resulting HTML file and run another pre-existing script that converts the HTML file into an RTF file. The problem is that I basically want to change the selection from selectedfile.TXT to selectedfile.HTML so that I can proceed to this next step...
    3. AND THEN, I want to launch an app with this resulting RTF file. Again, I need to change the selection to selectedfile.RTF.
    Right now this requires me to run three different automator services, and changing the selected file between each step... But I'm sure there's an easy applescript way (or other way) to do this using just one service -- probably involves some filename parsing and some magic to change the selection??? -- or something like that...
    Could anyone point me in the right direction???
    Thank you thank you thank you!
    ~zyyyy

    Have you considered using a bash script? You can even write the script in an Automator Service.
    Open Automator and select Service from the main screen. Set the ‘Service Receives Selected’ pop-up menu to Files or Folders, and set the ‘in’ pop-up to Finder. Drag Run Shell Script from the Utilities section of the actions library into the workflow area. Set Pass Input to As Arguments. Replace the sample code in the input area with this:
    for f in "$@"
    do
    file_ext="${f##*.}"
    if [ $file_ext = "txt" -o $file_ext = "TXT" ] ; then
    /usr/bin/textutil -convert html "$f"
    /usr/bin/textutil -convert rtf "${f/$file_ext/html}"
    /usr/bin/open -a /Applications/TextEdit.app "${f/$file_ext/rtf}"
    fi
    done

  • Selecting unused color swatches using applescript?

    I cannot seem to remove unused colors from my swatches palette... got any suggestions?..
    here's a few sample of what i've done so far...
        --set ColorWell to every page item of group item 1 of layer "Image Layer" of current document as list
        --set ColorList to {} as list
        --set ColorList to name of every swatch of selection
        set ColorList to name of every swatch of imposition as list
        set ColorList2 to name of every swatch of current layer as list
        (*repeat with EachItem in ColorWell
            set ColorList to ColorList & (name of fill color of EachItem as string) as list
        end repeat*)
        --log ColorWell
        --log ColorList
        (*repeat with EachColor in ColorList
            if not (exists name of swatch EachColor) then
                    delete swatch EachColor of current document
            end if
        end repeat*)
        (*repeat with EachColor in ColorList
            --if swatch EachColor exists then
            if page items of ImageLayer contains {fill color:EachColor} then
                return
            else
                delete swatch EachColor of current document
            end if
            delay 1
        end repeat*)
        (*set PossibleColor to 1
        repeat (count swatches of current document) times
            if swatch PossibleColor of ImageLayer exists then
                return
            else
                delete swatch PossibleColor of current document
            end if
            set PossibleColor to PossibleColor + 1
        end repeat*)
    thanks...

    Try this:
    tell application "Adobe Illustrator"
    set myswatches to every swatch of document 1
    repeat with myswatchnum from (count of items in myswatches) to 1 by -1
    set myswatch to item myswatchnum of myswatches
    try
    set myfilledpaths to (path items of document 1 whose fill color = (color of myswatch))
    if myfilledpaths is {} then
    set mystrokedpaths to (path items of document 1 whose stroke color = (color of myswatch))
    if mystrokedpaths is {} then
    try
    delete swatch myswatchnum of document 1
    end try
    end if
    end if
    end try
    end repeat
    end tell

  • How to: Close "Getting Playlist" using applescript ?

    Hi *,
    How is it possible to close the iTunes "Getting Playlist" Pop-up window using applescript ?
    Take a look at --> http://www.cronomik.org/t1.jpg
    I have tried to do the following, but iTunes doesn't act.
    tell application "System Events"
    tell application "iTunes" to key code 53
    end tell
    Any ideas of how to fix my question ?
    Stefan

    I have got it working with this script.
    If iTunes Pop-up a message, I press a key on my remote control and the Pop-up message / Box disappears.
    tell application "System Events"
    tell process "iTunes"
    -- get the front window's name
    -- get the name of the front window
    set whichWindow to (get the name of the front window)
    -- Ergebnis: "Getting Playlist"
    -- display dialog result
    -- display dialog whichWindow
    -- Ergebnis: {button returned:"OK"}
    set whichButton to (get the name of the front window's button)
    -- Ergebnis: {"Stop"}
    tell whichButton of window whichWindow to key code 53
    -- set the contents of the button to key code 53
    end tell
    end tell
    In a terminal I have typed in "while true; do ./diut.app; sleep 2; done" to see what happend, if iTunes is front most and an iTunes message Pop-up.
    Solved by myself.

  • Selecting Objects In Aperture Help

    is there anyway to select, or build a selection of images in aperture using applescript. i am looking to do something like
    tell application "Aperture"
    set projID to project "ABC 123"
    set selection to image versions in projID
    end tell

    I use Illustrator pretty often but I'm not at a level that I understand scripting.  Maybe I'm out of luck then.

  • Can't select projects for iPhone to sync with Aperture

    I'm migrating from iPhoto to Aperture 3.3.1
    I'm on a 2009 Mac Mini using Lion.
    I can easily import iPhone photos into Aperture, no problem.
    I've managed to get iTunes to allow selecting sync between my iphone 4S (latest OS5) and Aperture. All well and good. But...
    What I don't seem to be able to do is select anything of substance to sync. For one thing, the only items available for sync are "Events"--for example "last 20 events" and macros like that. Since Aperture doesn't deal with "events" but rather "projects", I don't know how this translates.
    I have a lot of projects in Aperture, but unlike when I was syncing with iPhoto--where I could select from a long list of specific items I'd created in iPhoto, I don't see any option in iTunes to sync custom named Projects, Albums, or any such thing from Aperture. Only these simple macros for recent events. And even when I select something like "the 20 most recent events" and try to sync, nothing is synced. Nothing gets transferred when I do a sync. No photos get transferred to the iPhone.
    How do I get all of my projects to appear in iTunes as options to sync with my iPhone?

    I see, we have been cross posting
    What exactly are your settings in the "Previews" tab of the Aperture preferences? Have you enabled the sharing and the automatic creation of previews?
    If you are not sure, if previews have been generated for all your projects, force the creation by selecting all images and selecting "Photos > Update Previews".
    Since iPhoto and Aperture now share the same library, I don't understand why selecting Aperture as the sync source would be any different than selecting iPhoto in this regard.
    Do I understand you correctly - You have only one library right now, that you alternately open in Aperture and iPhoto?
    Then only one of the two Applications will show the contents: Aperture or iPhoto. The results I have show you above in my previous post do apply,  when I have two libraries, one used with iPhoto and one used with Aperture. The same library openened in turns with iPhoto or Aperture will only show all contents for one of the two apps; I assume this is to keep the photo cache inside the library small - otherwise you would have to waste space for two photos caches.
    When I try to sync my Aperture library with iTunes, I see all projects like shown above with the switch set to Aperture, but set to iPhoto I also see only the two events you have shown. So use the application to sync your photos that will show all albums or events/projects.
    Regards
    Léonie

  • I was getting messages that my Aperture Library was full, so I updated to Aperture 5.3.1. When I open it, I'm asked to update my library. When I select that option, I'm told that my library is full. Now I can't access my library at all. What should I do t

    Hi all,
    I was getting messages that my Aperture Library was full, so made an appointment at my closest Mac store, but have to wait 2 days. They advise you to update saoftware before coming in, so I updated to Aperture 5.3.1. When I open it, I'm asked to update my library. When I select that option, I'm told that my library is full. Now I can't access my library at all. What should I do to access my library? Do I have to uninstall 5.3.1 and reinstall an older version?
    Another problem I have recently encountered ... all the up and down scrollers on various screens have disappeared. They reappear fleetingly when I use my up and down arrowa, but I can't always catch them. How do I get my scrollers back?

    Thank you so much for your patient guidance and screen captures.
    You are welcome.
    My external hard drive is properly formatted for Aperture, so I am currently copying my Aperture library to it. That will take hours since it is copying 101 GB.
    o.k.
    I understand that I need to clean some space on my internal hard drive and reformat the Aperture library to get back in operation.
    You need to upgrade the Aperture library to be used with Aperture 3.5.1.  That will happen automatically, when you first double click the copied lirary to open it in Aperture.
    I'll also need to back up my external drive with a new external drive if I make space on my internal drive by removing some photos from there and store them on my current external drive.
    What do you use for backup? If you are using TimeMachine it is better to have only the Time Machine backup on the Time Machine drive . In that case would I put the Aperture library and other data on a new drive and keep the old drive for backup.

  • Pages '09: Can't use AppleScript for selected text inside tables?

    When I run get selection on selected text in a Pages document, I get something like this:
    <pre>text from character 1 to character 4 of body text of document id 9943974 of application "Pages"</pre>
    When I run get selection on selected text inside a table cell in a table in a Pages document, I get something like this:
    <pre>text from character 1 to character 4 of some table of document id 3539679 of application "Pages"</pre>
    When I run get selection on selected text inside a table cell in ANOTHER table in the same Pages document, I get the exact same thing. It still says "some" table. So there is no way to distinguish between tables if there are more than one table in the same Pages document.
    Am I correct in understanding that this means that most AppleScript commands for manipulating text are unusable inside table cells?
    For example, it seems impossible to get the properties of the selection when the selection is selected text inside "some" table. So it's impossible do anything about text styles, etc.
    Is AppleScript support in Pages ’09 really that limited, or am I missing something?

    The first script below should return the character style of any selection made in Pages ’09, whereas the second script should apply the "XXX" character style to any selection:
    --BEGINNING OF SCRIPT 1
    tell application "Pages"
    activate
    tell application "System Events" to tell process "Pages"
    -- Show the format bar:
    if not (pop up button 1 of window 1 exists) then
    click menu item "Show Format Bar" of menu 1 of menu bar item "View" of menu bar 1
    end if
    -- Show the styles drawer and character styles:
    if menu item "Show Styles Drawer" of menu 1 of menu bar item "View" of menu bar 1 exists then
    keystroke "t" using {shift down, command down}
    end if
    tell front window
    tell checkbox 1 of group 1 of drawer 1 -- “Show or hide character styles.” checkbox
    repeat until it exists
    delay 0.1 -- wait until the styles drawer is open
    end repeat
    if description is "show character style" then click
    end tell
    -- Get the row index (although it is not a property) of the character style:
    tell menu button 2 -- “Choose a character style.” menu button
    click
    set k to 0
    repeat
    set k to k + 1
    if value of attribute "AXMenuItemMarkChar" of menu item k of menu 1 exists then exit repeat
    end repeat
    keystroke return -- hide the menu
    end tell
    -- Get the character style name:
    if k > 1 then set k to k + 1
    value of static text 1 of row k of outline 1 of scroll area 2 of splitter group 1 of group 1 of drawer 1
    end tell
    end tell
    end tell
    --END OF SCRIPT 1
    --BEGINNING OF SCRIPT 2
    set myStyle to "XXX" -- the name of the character style you want to apply
    tell application "Pages"
    activate
    tell application "System Events" to tell process "Pages"
    -- Show the format bar:
    if not (pop up button 1 of window 1 exists) then
    click menu item "Show Format Bar" of menu 1 of menu bar item "View" of menu bar 1
    end if
    -- Show the styles drawer and character styles:
    if menu item "Show Styles Drawer" of menu 1 of menu bar item "View" of menu bar 1 exists then
    keystroke "t" using {shift down, command down}
    end if
    tell front window
    tell checkbox 1 of group 1 of drawer 1 -- “Show or hide character styles.” checkbox
    repeat until it exists
    delay 0.1 -- wait until the styles drawer is open
    end repeat
    if description is "show character style" then click
    end tell
    set characterStyles to value of static text 1 of rows of outline 1 of scroll area 2 of splitter group 1 of group 1 of drawer 1
    set k to 0
    repeat with thisStyle in the characterStyles
    set k to k + 1
    if thisStyle as text is myStyle then exit repeat
    end repeat
    -- Apply the character style:
    if k > 1 then set k to k - 1
    click menu button 2 -- “Choose a character style.” menu button
    click menu item k of menu 1 of menu button 2
    end tell
    end tell
    end tell
    --END OF SCRIPT 2
    I suppose that +paragraph styles+ should work the same.
    I'm beginning to know Pages ’09 a little better now.
    Message was edited by: Pierre L. (show format bar)

  • Albe to get a script working on a local machine. Can't on a Remote Mac using AppleScript

    Ok I was able to get the following code to work on a local Mac
    tell application "FileMaker Pro"
    name of every database
    end tell
    But when I tried to run it on a remote Mac using Applescript
    I got a syntax error of: "Expected class name but found identifier"
    I tried the following
    set RemMac to "eppc://10.1.2.3.4"
    set remoteApp to application "FileMaker Pro" of machine RemMac
    tell remoteApp
    name of every database
    end tell
    That didn't work, any ideas how I can use 1 Mac to check on another Mac's FileMaker's list of open databases
    Thanks

    Thanks Sherry, 
    This looks like it works perfectly
    I am just trying to understand how the times work.
    This is the snippet for a two hour maintenance window
     $a = Set-WmiInstance -Class CCM_ServiceWindow -Namespace 'ROOT\ccm\Policy\Machine\RequestedConfig' -PutType 'CreateOnly' ` -argument  @{PolicySource = 'LOCAL'; PolicyRuleID = 'NONE';  PolicyVersion = '1.0';  Schedules = '1D529B0010080000';  ServiceWindowType = 1;  ServiceWindowID = '8fa8c041-b6fc-4e3a-bd91-494af0e7f20d';  PolicyID = '8fa8c041-b6fc-4e3a-bd91-494af0e7f20d'; ` PolicyInstanceID = '8fa8c041-b6fc-4e3a-bd91-494af0e7f20d'}; $a.ServiceWindowID get-wmiobject -query "SELECT * FROM CCM_ServiceWindow" -namespace "ROOT\ccm\Policy\Machine\RequestedConfig"
    The things change are 'schedules','ServiceWindowID' , 'PolicyID' and 'PolicyInstanceID' and they seem to change, even when the same time is set e.g. create a 2, 3 hour service windows 
    Whilst getting the string is easy to work out using client centre. I am really curios to find out how these values translate to 1,2 and 3 hour service windows. The SDK doesn't shed a great deal of light on the subject (well not that I could find)
    Regards, Martin

  • 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.

  • I plan on buying a new  I Pad wit wifi and cell from Apple. But  I don't want to select a cell carrier right now. Q 1: Do I have to select a carrier at purchase? and Q 2, In the meantime will I be able to get on line at home using my Cox Internet wi fi co

    I plan on buying a new  I Pad wit wifi and cell from Apple. But  I don't want to select a cell carrier right now. Q 1: Do I have to select a carrier at purchase? and Q 2, In the meantime will I be able to get on line at home using my Cox Internet wi fi? Thanks. 

    Thanks for the help. Now I can feel comfortable in not having to sign up for cellular when I buy, esp. Since I'll be using my new IPad mostly at home on my Cox wi fi. Then I can see, in using the i pad, how often I'd actually use the cellular, and where. This can help decide which type of cell plan I get. Small problem it may seem, but a very helpful answer. Thanks.

  • Select by Note using Applescript

    I want to know if it's possible using Applescript to select items based on the contents of the Note field of the Attibutes Panel. It's used to select objects within Actions, so it seems like it should be possible.
    Unfortunately I'm not very good at scripting and can't seem to figure out the right syntax.
    Thanks in advance for any ideas or suggestions...
    Mike D.

    Hey, Mike:
    Yes, it's possible to select an item based on the contents of its Note.
    every page item whose note contains "testing" -- This would return a list of page items who has "testing" in the note. This includes an item with the word "retesting" so remember to be specific. These are only computers after all… they're not very smart! ;^)
    This is doable but remember you can name any and all items on a page and select them based on that parameter. Unless you have a particular reason to use the Note property I would use Name but either way can be worked out.
    Cheers,
    storm371

  • Using javascript : menutabs/ commandMenuItem has to get selected. How?

    I have piece of code in my jspx JSF page as follows
    <af:menuTabs id="menuTabs1">
    <af:commandMenuItem id="wo1" text="#{msg['menubar.workorder']}" onclick="javascript: getSubMenu('#{msg['menubar.workorder']}');"
    action="#{MenuSubMenu.menuButton_Action}" />
    <af:commandMenuItem id="ts1" text="#{msg['menubar.troubleshooting']}" onclick="javascript: getSubMenu('#{msg['menubar.troubleshooting']}');"
    action="#{MenuSubMenu.menuButton_Action}"/>
    </af:menuTabs>
    Using java script function i want to make the clicked CommandMenuItem as selected.
    i tried like this
    if(document.getElementById('tilesView2:menu:menu:menuTabs1:wo1') !=null)
    alert("6");
    document.getElementById('menuTabs1:wo1').selected = true;
    But it is not getting selected.
    Need help!!!!!!!!!

    Thanks jgkoops.
    I agree that the "selected" property is limited to select box options and radio buttons...in normal HTML tags scenario.
    But in ADF tags when you see list of attributes of <af:commandMenuItem> we have "selected" as one of those.
    As we can call the attributesNames in javascript as document.getElementByID('idName').attributeName = "something";
    i.e., document.getElementByID('wo1').style = "some Style";
    document.getElementByID('wo1').name = "some Name"
    document.getElementByID('wo1').value = "some Value "...etc
    the above said are working but
    document.getElementByID('wo1').selected="true"; is not working.
    Hope you understand my argument.

  • I Reinstalled Premiere Pro CS3, loaded a project I edited using CS3, and NOW I get jagged edges!

    Hey everyone. I was using Premiere Pro CS3 to edit some footage I shot with my HPX170 in 1080i 24p Advanced. The P2 footage looked great in Premiere CS3. I upgraded to Premiere CS5, imported the same exact project into CS5 using the same 1080i 24p Advanced setting, and I got jagged stair stepping edges on the objects that were in sharp focus in my footage. Okay, I thought, I'll just reinstall Premiere Pro CS3 and continue editing the footage in CS3 since it looked normal in CS3 with no jagged edges. But, to my surprise, I'M GETTING THE SAME EXACT THING NOW IN PREMIERE PRO CS3!!!! What in the heck is up with that? How can the footage look normal when I imported and editied it before in CS3 and NOW I get jagged stair stepping edges?!!!! I even tried importing a fresh clip from the footage and that clip still has the jagged stair stepping edges. This makes no sense whatsoever! Does anyone know what's going on with this? It seems like an interlace artifact problem BUT, if that's the case, why didn't it do this the first time in Premiere Pro CS3? And trust me, I would have noticed right away if it did!

    Hey Shooternz. Which exact playback settings are you asking about? I set the one of the playback settings to "Highest Quality" instead of "Automatic" and nothing changed. I unchecked 24p Pulldown in the "Interpret Footage" section and nothing changed (I don't even remember "24p Pulldown" being in the Interpret Footage section the first time I installed CS3, which is strange. Was that added in an update?). I tried different sizes like HD 1.5, HD 16:9, etc. in the Interpret Footage section and the jaggies are still there. Nothing seems to work. ??? This is weird because they weren't there the first time I edited the footage in CS3 when I installed CS3 the first time. One thing I noticed is, when I installed CS3 the second time and loaded the project, as the project was loading, I got a message that said something like "These project settings cannot be loaded. We will now switch to Desktop Mode." Would that have something to do with it you think?

Maybe you are looking for