Skip to main content

⚠️ Please note that this topic or post has been archived. The information contained here may no longer be accurate or up-to-date. ⚠️

Applescript to automatically process images

Comments

4 comments

  • Rick Allen
    Have a look at http://www.phaseone.com/en/SupportMain/ ... -Page.aspx

    There is no simple way for you to access color tag or ratings from applescript. That I know of, happy to be proven wrong if you show me the code 😊 .

    You can add the processed files to a list so that they dont get processed twice.
    0
  • Corey Riggle
    I may have some technology that could help you. Please feel free to reach out and I may be able to adapt what I'm working on to your situation.
    corey@coreyriggle.com

    [quote="NN634868622653107646UL" wrote:
    Hi there,

    Wondering if anyone out there can shed any light on the language needed to automatically process all files in a given folder that meet certain criteria, i.e. color tagged green, or 5 star, etc... And then, to not reprocess those same files when new ones are added--essentially referencing the process state, possibly from a plist....

    Most of the examples i have found onlline refer to c1 3.7.x. Those that i have seen regarding c1 6/7 are mostly gui scripting--whole other problem....

    Any and all thoughts and examples would be greatly appreciated.
    0
  • Martin Knowles
    Assuming you have your C1 'Auto Sync Sidecar XMP' set to 'Full sync', for each sidecar XMP, call one of these to get the colour number and rating. There's probably a better way to do this, but:

    on getColor(xmpFile)
    tell application "System Events"
    set theRDF to XML element 1 of XML element 1 of contents of XML file xmpFile
    repeat with theDescription in every XML element of theRDF
    repeat with E in every XML element of theDescription
    if name of E is "photoshop:Urgency" then
    return value of E
    end if
    end repeat

    end repeat
    end tell
    end getColor

    on getRating(xmpFile)
    tell application "System Events"
    set theRDF to XML element 1 of XML element 1 of contents of XML file xmpFile
    repeat with theDescription in every XML element of theRDF
    repeat with E in every XML element of theDescription
    if name of E is "xmp:Rating" then
    return value of E
    end if
    end repeat

    end repeat
    end tell
    end getRating
    0
  • Rick Allen
    I've never been very successful at parsing xml with system events....
    for instance you SHOULD be able to parse the .cos file as well but for the life of my I can't work it out.

    choose file without invisibles

    tell application "System Events"
    set xmlFile to POSIX path of result
    set output to {Basic_rating:""}
    tell XML element "AL" of XML element "VAR" of XML element "IMG" of XML file xmlFile
    repeat with theElement in XML elements
    tell theElement
    if value of XML attribute "K" is "Basic_rating" then
    set Basic_rating of output to its value
    end if
    end tell
    end repeat
    end tell
    end tell

    return output
    -- does Not WORK???
    0

Post is closed for comments.