Keywords missing in AppleScript
Hi,
I'm quiet happy that extended Apple Script support got extended in C1 10.
That said, it doesn't seem to allow access to an image (or variants) keywords. That's causing me issues because it's my main use case for Applescript in C1. Especially since workarounds via XMP sidecar files using reload metadata and sync metadata won't work here: The XMP is naturally bound to the actual image (file) instead of variants for an image and those variants keywords often have different keywords.
Is there something I'm missing?
Best
-Torsten
I'm quiet happy that extended Apple Script support got extended in C1 10.
That said, it doesn't seem to allow access to an image (or variants) keywords. That's causing me issues because it's my main use case for Applescript in C1. Especially since workarounds via XMP sidecar files using reload metadata and sync metadata won't work here: The XMP is naturally bound to the actual image (file) instead of variants for an image and those variants keywords often have different keywords.
Is there something I'm missing?
Best
-Torsten
0
-
Same here. 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, sorry if the above has nothing to do with what you're hoping to do with AppleScript.0 -
Oh, I also found this blog post on Applescripting Keywords in Capture One 10:
http://www.buggeringabout.com/applescri ... pture-one/
I don't really understand how they are isolating the IPTC Scene field specifically. I don't see that in their code. Then again, I'm more of a newb to AppleScript so could be missing something very easy/basic.0 -
I am able to write to the metadata fields of a varaint in COP 10. (I have only tried one field so far)
In this work, I find that its key to consult the Applescript Dictionary for COP 10. Start Script Editor, on the menu bar at the top File>Open Dictionary then select the COP Dictionary. There are two parts to the COP 10 dictionary, the standard suite and the Capture One Suite. In the Capture One Suite, there is a lot of information on accessing the metadata fields in the variant item. Although it does not say so, the metadata fields in the variant can read or written.
There is no direct access to keywords in COP 10 from Applescript.
Here is some simple code that reads and sets the source metadata field (in the status section) of the selected images
tell application "Capture One 10"
set selectedVariants to (get selected variants)
tell document 1 -- as far as I can tell there is only ever 1 document
if selectedVariants is {} then
display notification "No images selected - select one or more images"
else
repeat with Counter from 1 to count of selectedVariants
set thisVariant to item Counter of selectedVariants
set oldStource to get status source of thisVariant
set status source of thisVariant to "test"
end repeat
end if
end tell
end tell
Here are some other useful Applescript commands for COP 10
tell application "Capture One 10"
set copVersion to (get app version)
set everyDoc to get every document
set allVariants to (get all variants)
set thisVariant to (get primary variant)
set everyImage to get every image
set everyImageNameList to get name of every image
set everyImageIDList to get id of every image
tell document 1 -- as far as I can tell there is only ever 1 document, and that is the open catalog or session
set parentImage to (get parent image of thisVariant)
set Instructions to (get status instructions of thisVariant)
set JobID to (get status job identifier of thisVariant)
set everyCollection to get every collection
set thisDocName to (get name of document doc_Counter) as text -- only index allowed is 1
set thisDocFolder to (get folder of document thisDocName) as text
set thisDocKind to (get kind of document thisDocName) as text
set thisDocPath to (get path of document thisDocName) --subset of thisFolder
end tell
end tell
( note also my other post with an Applescript )
I hope that helps0 -
Thanks so much Eric! Really helpful and now gives us a reason to upgrade the whole studio to v10.
One side question, looking through the dictionary I found the "next capture adjustments" tag but how is that implemented? I've tried:set next capture adjustments to last captured file
but AppleScript errs with "Can’t set last captured file to last captured file." Being a newb I don't know how to interpret and get the correct section of the Next Capture Adjustments. I'm specifically looking for the metadata next capture adjustment but if I can just change all to "Copy from Last" that would be fine.0 -
[quote="NN636136542251646652UL" wrote:
Thanks so much Eric! Really helpful and now gives us a reason to upgrade the whole studio to v10.
One side question, looking through the dictionary I found the "next capture adjustments" tag but how is that implemented? I've tried:set next capture adjustments to last captured file
but AppleScript errs with "Can’t set last captured file to last captured file." Being a newb I don't know how to interpret and get the correct section of the Next Capture Adjustments. I'm specifically looking for the metadata next capture adjustment but if I can just change all to "Copy from Last" that would be fine.
I don't use image capture (my cameras are incompatible) but I see that youare trying an assignment statement "set ... to ..." but the kind of thing that you are setting "capture adjustments" is not the same kind of thing that your are trying to set it to "file" and this one problem.
After a little but of fiddling, I understand i this way: there are 4 choices for the property "Next Capture Adjustments", the property contols how COP chooses Next Capture Adjustments. These choices are represented by the enum (Default/‌Last/‌Primary/‌Using Clipboard) - this enum is not documented - forgotten, I think.
Applescript will permit the following:
get Next Capture Adjustments -- this returns one of four values: (Default/‌Last/‌Primary/‌Using Clipboard)
set Next Capture Adjustments to Default -- (or to Last or to Primary or to Using Clipboard)
How the Primary adjustments or the Default adjustments are set and maniplulated, I don't know. But one you have them, you can choose them.
I rarely upgrade to new SW on the first release. Not Apple, not Microsoft, not Capture One, and not any other vendor. (I just upgraded some laptops from OSX 10.10.5 to 10.11.6 Nice stable releases, both of them 😄 ).
If your studio business depends on COP, I wouldd stick with what you have working until 10.1 or 10.2 In this release I note that the Applescript/COP will eventually hang the Mac if you get the properties or all the variants or all the images of the application when the application has a very large number of images (like 15000). I will be opening a ticket on this shortly.
There are probably a few more bugs being flushed out at this stage.0 -
Thanks again for the help Eric. Again, a mixed bag of results.
First issue, the code "works" for three of the four enums (Default, Primary and Using Clipboard). Unfortunately the one that I need to use (Last) is throwing a syntax error: "Expected class name but found end of line."
Here is what I put in there which is throwing this error:
tell application "Capture One 10"
set next capture adjustments to Last
-- or to Last or to Primary or to Using Clipboard
end tell
end tell
Second issue, this is only modifying the "All Other" option within Next Capture Adjustments. There are five options to modify in that section. The one I need to work with is Metadata.
https://commonuse.s3.amazonaws.com/External%20Send%20Files/NextCaptureAdjustments.png
So, when I change "Last" in the code above to Default, Primary or Using Clipboard and run it the dropdown next to All Other changes. But there is nothing obvious in the code that is calling that specific option How in the world would I be able to figure out how to choose the Metadata option instead. Grrr, this is what I find frustrating with coding.0 -
[quote="NN636136542251646652UL" wrote:
Thanks again for the help Eric. Again, a mixed bag of results.
First issue, the code "works" for three of the four enums (Default, Primary and Using Clipboard). Unfortunately the one that I need to use (Last) is throwing a syntax error: "Expected class name but found end of line."
Here is what I put in there which is throwing this error:
tell application "Capture One 10"
set next capture adjustments to Last
-- or to Last or to Primary or to Using Clipboard
end tell
end tell
I get the same behavior. (except that this code snippet has an extra "end tell") This is an obvious case for a support request. I would write: 1) Documentation of the enum is missing in the COP Applescript Dictionary (it should be there - for example check the entry under Suit: COP Class:Application , "Shutter Latency" 2) One of the enum values is not supported. Is the name wrong?[quote="NN636136542251646652UL" wrote:
Second issue, this is only modifying the "All Other" option within Next Capture Adjustments. There are five options to modify in that section. The one I need to work with is Metadata.
https://commonuse.s3.amazonaws.com/External%20Send%20Files/NextCaptureAdjustments.png
So, when I change "Last" in the code above to Default, Primary or Using Clipboard and run it the dropdown next to All Other changes. But there is nothing obvious in the code that is calling that specific option How in the world would I be able to figure out how to choose the Metadata option instead. Grrr, this is what I find frustrating with coding.
I would raise a (separate) support request for enhancing this feature. I think you want a "NextCaptureMetaData" feature.0 -
Thanks Eric! Will submit a support ticket. 0 -
Well, this isn't helpful! Case closed as we do not support scripting.
Kind Regards
Phase One support0 -
[quote="NN636136542251646652UL" wrote:
Well, this isn't helpful!Case closed as we do not support scripting.
Kind Regards
Phase One support
They don't support scripting! 🤓 On the Phase One Web site in the nice advertisement for Capture One Pro 10 on the Phase One Web site it says:Apple Script Extended (Mac Only)
Meta data fields, variant selection and EIP pack state can now be targeted for automation routines.
It's not like we have asked for a tutorial on scripting - CaptureOne has a partially broken feature and mistaken documentation.
Well not much we can do about it. Except that I will mention it in other fora.0 -
Ok, our new beta is out. Might be worth checking out for... well. Things. 😉
www.phaseone.com/beta0 -
Thanks James. The AppleScript additions in v10.1.1 are very welcomed! 0 -
Can someone post an example setting a keyword in a selected file?
Thanks in advance.0
Post is closed for comments.
Comments
13 comments