You are here

5 posts / 0 new
Last post
Moving IPTC metadata within an image via AppleScript / Automator #1
heidger's picture
by heidger
March 31, 2014 - 7:45pm

I am currently overhauling my 40,000+ images Aperture library and I have realized that I have “misused” a few of the IPTC metadata fields, such as “Usage Terms”. I have stored specific information on where I uploaded the image, how often I printed it, etc. in this field, and now I realize that this should have been used for job-specific licensing terms that have been granted or generic statements, such as “All rights reserved, no reproduction without prior permission”.

Is there a way how I could automate this transfer of data from one field to another? I have created a new field with “Manage Custom Fields” that can hold the info and I am ok with the fact that it would not get exported as it is internal information for myself anyway…

From what I have seen, the Automator action for IPTC data doesn’t support this field, is there anything else that I can do, without having to do this manually….?

Thanks so much!

- heidger

my photography: http://www.heidgermarx.com

Walter Rowe's picture
by Walter Rowe
April 5, 2014 - 12:17am

The AppleScript interface to Aperture lets you read IPTC tags and create/set custom tags.

http://images.apple.com/aperture/resources/pdf/Aperture_3_AppleScript_Re…

See page 7-8 about custom tags. See page 12 about IPTC tags. See Appendix B, page 34-35 for the IPTC tag mappings.

From a cursory look at this, it appears you could select some images and run an action that would set your custom tag to the value of  your UsageTerms IPTC tag.

Walter Rowe's picture
by Walter Rowe
April 6, 2014 - 2:03pm

I did some cursory playing with an AppleScript example and this can be done.

You need to create a new AppleScript with AppleScriptEditor and copy-n-paste the following code into your new script. For any selected image(s) in Aperture, it will see if Usage Terms has been set. If it has been set, it will copy that value over to a new custom field called “mytag”. You can change the name of that in your copy. Just change the reference everywhere it appears. You don’t have to create the custom field “mytag”. The script will create it if it doesn’t exist.

This skeleton should work for copying the value of any editable attribute from one field to another. You would have to look at the Aperture AppleScript Guide to get the proper way to reference the source and target fields.

————-

tell application “Aperture”

    set imageSel to the selection

    repeat with i from 1 to count of imageSel

        tell library 1

            tell item i of imageSel

                if (exists IPTC tag “UsageTerms”) then

                    set rights to value of IPTC tag “UsageTerms”

                    if (exists custom tag “mytag”) then

                        set value of custom tag “mytag” to rights

                    else

                        make custom tag with properties {name:”mytag”, value:rights}

                    end if

                end if

            end tell

        end tell

    end repeat

end tell

————-

I used this web site as a reference to figure all this code out. It is my first AppleScript script, and my first Aperture script. I have others I now want to write for custom naming of my images.

https://github.com/danielpietzsch/Applescripts-for-Aperture

heidger's picture
by heidger
April 6, 2014 - 3:41pm

Thank you so much, Walter for posting this solution I will try it out and post my results. I greatly appreciate your time figuring this all out. - heidger

my photography: http://www.heidgermarx.com

areohbee's picture
by areohbee
October 14, 2014 - 11:25pm

I second the notion: thank you Walter!

Rob

You may login with either your assigned username or your e-mail address.
Passwords are case-sensitive - Forgot your password?