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: 74
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: 167
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: 74
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: 637
Joined: Thu Dec 03, 2009 10:00 pm

Re: Add data to Metadata fields via AppleScripts

Postby Corey Riggle » Tue Mar 27, 2018 8:28 pm

With a lot of help from Rapdigital and the forum, I came up with this.
Hopefully more examples help others.


Code: Select all
--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 tell
Corey Riggle
NYC
Digital Capture Specialist
Corey Riggle
 
Posts: 74
Joined: Thu Feb 05, 2009 10:51 pm

Re: Add data to Metadata fields via AppleScripts

Postby Eric Nepean » Wed Mar 28, 2018 3:35 am

WhT version of Capture One are you now using?
Cheers, Eric
[late 2015 iMac, 4GHz i7, 24GB RAM, external SSDs. GX8, E-M1, GX7, GM5, GM1 ....]
Eric Nepean
 
Posts: 266
Joined: Sat Oct 25, 2014 8:02 am

Re: Add data to Metadata fields via AppleScripts

Postby Corey Riggle » Wed Mar 28, 2018 4:38 am

Eric Nepean wrote:WhT version of Capture One are you now using?


This was created with 10.
Corey Riggle
NYC
Digital Capture Specialist
Corey Riggle
 
Posts: 74
Joined: Thu Feb 05, 2009 10:51 pm

Re: Add data to Metadata fields via AppleScripts

Postby rapdigital » Wed Mar 28, 2018 1:46 pm

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.

Code: Select all
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 tell
rapdigital
Certified Professional
Certified Professional
 
Posts: 167
Joined: Mon Feb 02, 2009 1:52 pm


Return to Scripting



Who is online

Users browsing this forum: No registered users and 1 guest