Add data to Metadata fields via AppleScripts

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

Add data to Metadata fields via AppleScripts

Postby SeanMurp » Fri Jan 06, 2017 11:49 pm

I'm having issues with trying to add data to the metadata fields in CaptureOne 9 (and assume the same issue exists in CO10). A different team at our company figured out how to enter data into the different metadata fields (even in Capture One 9), but I'm having a hard time getting it to work for my AppleScripts and can't get ahold of the people that created the original scripts. Perhaps you can help interpret it? And was a bit disappointed that I'm not seeing anything in CO10 that calls out the metadata in the AppleScript dictionary.

(Easier to read without the code function of this forum)

---------------go to metadata tool tab---------------
tell application "Capture One 9" to activate
tell application "System Events"
tell process "Capture One"
set frontmost to true
click menu item "Metadata" of menu 1 of menu item "Select Tool Tab" of menu 1 of menu bar item "View" of menu bar 1
end tell
end tell
-------delay--------------
delay 1
-------------insert copied excel data to metadata------------
tell application "Capture One 9" to activate
tell application "System Events"
tell process "Capture One"
set frontmost to true
--------new metadata
set value of text field 2 of row 49 of outline 1 of scroll area 1 of group 3 of window 1 to photographer
set value of text field 2 of row 37 of outline 1 of scroll area 1 of group 3 of window 1 to stylist
set value of text field 2 of row 48 of outline 1 of scroll area 1 of group 3 of window 1 to bayname
set value of text field 2 of row 58 of outline 1 of scroll area 1 of group 3 of window 1 to budgetline
set value of text field 2 of row 66 of outline 1 of scroll area 1 of group 3 of window 1 to artdirector
set value of text field 2 of row 59 of outline 1 of scroll area 1 of group 3 of window 1 to model
set value of text field 2 of row 60 of outline 1 of scroll area 1 of group 3 of window 1 to digitaltech
set value of text field 2 of row 63 of outline 1 of scroll area 1 of group 3 of window 1 to hairmakeup
end tell
end tell



The end of the 'set value' lines are the variables. I figured all I would have to do is change the variables to fit with my scripts but I keep getting this error:
"System Events got an error: Can’t get outline 1 of scroll area 1 of group 3 of window 1 of process \"Capture One 9\". Invalid index." number -1719 from outline 1 of scroll area 1 of group 3 of window 1 of process "Capture One 9"


I figure this is just looking for the specified row to enter the metadata, but they are using CO9 as well so it should work, no? Anyways, if anyone has any knowledge of this I'd really appreciate it.
SeanMurp
 
Posts: 43
Joined: Wed Nov 02, 2016 4:30 am

Re: Add data to Metadata fields via AppleScripts

Postby rapdigital » Wed Jan 11, 2017 11:15 am

UI scripting is very temperamental (IE almost never works across different systems).
If you workspace isn't exactly the same as the original workspace you'll run into errors like these.
What fields are you trying to map the variables to?
The way to do it is to use full sync in metadata preferences edit the xml file via applescript the load metadata in CO.

Not simple but possible :roll:
rapdigital
Certified Professional
Certified Professional
 
Posts: 148
Joined: Mon Feb 02, 2009 1:52 pm

Re: Add data to Metadata fields via AppleScripts

Postby SeanMurp » Wed Jan 11, 2017 5:18 pm

Just a few:
    Creator
    Creator's Job Title
    Address
    Ciry
    Postal Code
    Headline
    Category
SeanMurp
 
Posts: 43
Joined: Wed Nov 02, 2016 4:30 am

Re: Add data to Metadata fields via AppleScripts

Postby Jim_DK » Wed Feb 01, 2017 5:32 pm

Actually no.

CO10 has properties for all:

Image meta data (e.g Exif stuff which is R/o)
Variant meta data (e.g IPTC stuff which is R/w).

It makes meta data automation a lot easier!

You can find the properties in the CO10 dictionary under the Capture One Suite> Variant
James
Phase One DK
Jim_DK
Crew
Crew
 
Posts: 610
Joined: Thu Dec 03, 2009 10:00 pm


Return to Scripting



Who is online

Users browsing this forum: No registered users and 3 guests