Zum Hauptinhalt gehen

⚠️ Please note that this topic or post has been archived. The information contained here may no longer be accurate or up-to-date. ⚠️

Copy keywords from single image

Kommentare

9 Kommentare

  • Eric Valk
    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.
    0
  • Eric Valk
    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.
    0
  • NNN636547779233695174
    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
    0
  • Eric Valk
    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.
    0
  • NNN636547779233695174
    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!
    0
  • Eric Valk
    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.

    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.
    0
  • Eric Valk
    And here is athe final version that notifies you if you have not selected a variant, or the variant has no keywords.


    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
    0
  • NNN636547779233695174
    Eric,

    I apologize for the delay in my response. I have zero experience with scripting, so it took me awhile to figure out how to implement this. But I figured it out, tested it, and it works just as you described! This works perfectly for what I need. I can't thank you enough!
    0
  • Eric Valk
    [quote="NNN636547779233695174" wrote:
    Eric,

    I apologize for the delay in my response. I have zero experience with scripting, so it took me awhile to figure out how to implement this. But I figured it out, tested it, and it works just as you described! This works perfectly for what I need. I can't thank you enough!

    No problem, glad to hear you got it working.
    If you had asked I would have pointed you to a write up I've done on that on the Scripting forum. 😊
    If you've go other scripting questions the scripting forum is a good place to ask.

    I occasionally post some cool scripts there.
    0

Post ist für Kommentare geschlossen.