Add data to Metadata fields via AppleScripts
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)
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:
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.
(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.
0
-
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 🙄0 -
Just a few: - Creator
Creator's Job Title
Address
Ciry
Postal Code
Headline
Category0 -
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> Variant0 -
With a lot of help from Rapdigital and the forum, I came up with this.
Hopefully more examples help others.--this adds the model's name to Personalities metadata field
display dialog "model name?" default answer "" with icon note buttons {"Cancel", "Continue"} default button "Continue"
set model to text returned of the result
tell application "Capture One 10" to tell current document to tell current collection
repeat with thisVariantIndex from 1 to count of every variant
tell variant thisVariantIndex to set Getty personalities to model
end repeat
end tell0 -
WhT version of Capture One are you now using? 0 -
[quote="Eric Nepean" wrote:
WhT version of Capture One are you now using?
This was created with 10.0 -
This version will ask you to make sure a folder is fully loaded before adding the metadata. If you haven't opened a large folder of images in the current session before it takes time to load the folder, indicated by the image count above the thumbnail viewer. display dialog "model name?" default answer "" with icon note buttons {"Cancel", "Continue"} default button "Continue"
set model to text returned of the result
tell application "Capture One 10" to tell current document to tell current collection
--set thePath to path of parent image of variant 1
set theNumber1 to count of every variant
delay 0.1
set theNumber2 to count of every variant
if theNumber1 ≠theNumber2 then
display dialog "Please wait for folder to load. Once loaded hit continue" buttons {"Cancel", "Continue"} default button "Continue"
end if
repeat with thisVariantIndex from 1 to count of every variant
tell variant thisVariantIndex to set Getty personalities to model
end repeat
end tell0
Post is closed for comments.
Comments
7 comments