Page 1 of 1

Apple script to export images based on keyword hierarchy

PostPosted: Mon Oct 22, 2018 7:46 pm
by nadigo
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

Re: Apple script to export images based on keyword hierarchy

PostPosted: Tue Oct 23, 2018 8:47 pm
by ben_US
I've moved this to the Scripting forum, where you'll likely see more interest and conversation regarding your query.

Re: Apple script to export images based on keyword hierarchy

PostPosted: Thu Oct 25, 2018 4:54 am
by Eric Nepean
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&"]"