Apple script to export images based on keyword hierarchy

Discussion regarding all scripting related questions
Please DO NOT post to this thread anything that is not directly related to scripting of Capture One.

Apple script to export images based on keyword hierarchy

Postby nadigo » Mon Oct 22, 2018 7:46 pm

Hi,

I am looking for an apple script to export images based on keyword hierarchy.
Let say my keyword tree looks like

Places
--------USA
--------Europe
--------Canada

I would like to create a script / process that will create a folder structure based on that hierarchy with the relevant images

/Places/USA
/Places/ Europe
/Places/ Canada

and so forth

Any idea how to do so ?

Nadav
nadigo
 
Posts: 1
Joined: Tue Jun 16, 2015 3:20 pm

Re: Apple script to export images based on keyword hierarchy

Postby ben_US » Tue Oct 23, 2018 8:47 pm

I've moved this to the Scripting forum, where you'll likely see more interest and conversation regarding your query.
Please make a support case for Technical Support with Capture One software:
http://support.phaseone.com and click on Contact Support, then select Technical Support.
ben_US
Crew
Crew
 
Posts: 649
Joined: Mon Feb 01, 2016 9:51 pm
Location: New York, USA

Re: Apple script to export images based on keyword hierarchy

Postby Eric Nepean » Thu Oct 25, 2018 4:54 am

That shouldn't be too hard.

1. get the name and parent of every keyword
Code: Select all
tell application "Capture One 11" to set {name_s, parent_s} to get {name, parent} of keywords of theVariant

2 find the key word whose parent is "Places"
Code: Select all
set found_it to false
repeat with i from 1 to count of name_s
    if "Places = (get item i of parent_s) then
        set found_it to true
        set theFolderName to (get item i of name_s)
        exit repeat
    end if
end repeat
if not found_it then return


3. The export AS command only exports originals. To export a variant you must use the AS process command, which uses a process recipe.

The simple approach is to have a predefined process recipe for each "place"
The more complex approach is to have only one process recipe
** manually set the root folder location of the process recipe to the "places" folder
** with AS set the output sub folder of the process recipe to "["&theFolderName&"]"
Cheers, Eric
[late 2015 iMac, 4GHz i7, 24GB RAM, external SSDs. GX8, E-M1, GX7, GM5, GM1 ....]
Eric Nepean
 
Posts: 477
Joined: Sat Oct 25, 2014 8:02 am
Location: Ottawa


Return to Scripting



Who is online

Users browsing this forum: No registered users and 0 guests