Copy keywords from single image

Discussions, questions, comments and suggestions regarding Capture One PRO, Capture One PRO(For Sony), Capture One DB and Capture One Express(For Sony) 11.x for Mac

Copy keywords from single image

Postby NNN636547779233695174 » Thu Dec 06, 2018 8:33 pm

Is there a way to copy all keywords from a single image? I am hoping to be able to do so in order to paste those keywords into a text file. I can see all the keywords on an image, I can get a different view of their hierarchy, but there doesn't seem to be a simple way to copy them with the intent to paste.

Any help is appreciated.
Thank you.
NNN636547779233695174
 
Posts: 5
Joined: Wed Feb 21, 2018 3:45 am

Re: Copy keywords from single image

Postby Eric Nepean » Fri Dec 07, 2018 1:36 pm

It's possible to do this with a simple AppleScript but I am don't know of any CO setting to do this. If you are interested, we need to have a short discussion on how multiple key words should be separated and how hierarchical keywords should handled and I can write such a script.
Cheers, Eric
[late 2015 iMac, 4GHz i7, 24GB RAM, external SSDs. GX8, E-M1, GX7, GM5, GM1 ....]
Eric Nepean
 
Posts: 320
Joined: Sat Oct 25, 2014 8:02 am

Re: Copy keywords from single image

Postby NNN636547779233695174 » Fri Dec 07, 2018 7:17 pm

Thank you for your response, Eric. I really appreciate it. For what I am currently needing this for, hierarchy doesn't need to be maintained. I would like each level to be represented, but each word just needs to be separated by a comma.
Example:

Travel
-Europe
-Asia
-Mexico
-Canada

Studio
-Product
-Portrait
-Family

This could be summarized to:
travel, europe, asia, mexico, canada, studio, product, portrait, family
NNN636547779233695174
 
Posts: 5
Joined: Wed Feb 21, 2018 3:45 am

Re: Copy keywords from single image

Postby Eric Nepean » Fri Dec 07, 2018 7:34 pm

I will write something this weekend. It may be that if I just take the keywords in order, the order may be unexpected, e.g.
travel, studio, mexico portrait - have to see.
Cheers, Eric
[late 2015 iMac, 4GHz i7, 24GB RAM, external SSDs. GX8, E-M1, GX7, GM5, GM1 ....]
Eric Nepean
 
Posts: 320
Joined: Sat Oct 25, 2014 8:02 am

Re: Copy keywords from single image

Postby NNN636547779233695174 » Fri Dec 07, 2018 8:06 pm

The order wouldn't matter at all. I am just needing all the keywords, parent or child, in some form that and can easily select and copy. It's a pretty simple thing that I wish I could do within C1, but it just seem possible. I tried accomplishing what I needed by exporting the image and then doing a simple Get Info on the exported file. The Info box shows me the keywords just as I need them, in a listed form, and I can select them and copy them. The only issue that keeps this from being my solution is that the Info box is limited to 2 lines. So a certain amount of keywords show and then it will say "...+7 more". So I cannot get the complete list using this method.

Long explanation, but I hope that helps describe the simplicity of what I'm going for.

Thanks Eric!
NNN636547779233695174
 
Posts: 5
Joined: Wed Feb 21, 2018 3:45 am

Re: Copy keywords from single image

Postby Eric Nepean » Fri Dec 07, 2018 9:09 pm

I don’t have access to my Mac right now. (but I started writing code in 1967) so let’s give this a shot ....

Edit1: it should be primary variant not selected variant
Edit 2: Fixed the quotes. Tested it, it works.
Code: Select all
tell application "Capture One 12" to tell primary variant to set theKwNameList to name of keywords
set KwNameString to ""
set kwctr to 0
set kwcount to count of theKwNameList
repeat with theKwName in theKwNameList
   set kwctr to kwctr + 1
   set KwNameString to KwNameString & theKwName
   if kwctr < kwcount then set KwNameString to KwNameString & ", "
end repeat

set the clipboard to KwNameString


If you select a variant and run this script, a list of the keyword names should end up on the OSX clipboard. This can then be pasted into a text document. It’s possible that Script Editor may complain about the double quotes, in which case replace them using script editor.

Let me know how that goes.

It should gracefully handle no keywords, but will declare an error if there is no selected variant.
Cheers, Eric
[late 2015 iMac, 4GHz i7, 24GB RAM, external SSDs. GX8, E-M1, GX7, GM5, GM1 ....]
Eric Nepean
 
Posts: 320
Joined: Sat Oct 25, 2014 8:02 am

Re: Copy keywords from single image

Postby Eric Nepean » Sat Dec 08, 2018 1:51 am

And here is athe final version that notifies you if you have not selected a variant, or the variant has no keywords.

Code: Select all
use AppleScript version "2.5"
use scripting additions

## if no variant is selected, "No Variant selected" is written to the clipboard
## If there are no key words, "No Keywords"  is written to the clipboard

try
   tell application "Capture One 12" to tell primary variant to set theKwNameList to name of keywords
on error
   set the clipboard to "No Variant selected - no keywords"
   display notification "No Variant selected - no keywords"
   return
end try

set KwNameString to ""
set kwctr to 0
set kwcount to count of theKwNameList

if 0 = kwcount then
   set the clipboard to "Variant has no keywords"
   display notification "Variant has no keywords"
   return
end if

repeat with theKwName in theKwNameList
   set kwctr to kwctr + 1
   set KwNameString to KwNameString & theKwName
   if kwctr < kwcount then set KwNameString to KwNameString & ", "
end repeat

set the clipboard to KwNameString
Cheers, Eric
[late 2015 iMac, 4GHz i7, 24GB RAM, external SSDs. GX8, E-M1, GX7, GM5, GM1 ....]
Eric Nepean
 
Posts: 320
Joined: Sat Oct 25, 2014 8:02 am


Return to Capture One 11.x Software for Mac



Who is online

Users browsing this forum: No registered users and 2 guests