Skip to main content

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

Show All Contents of Library Folders; Shortcut Keystrokes

Implemented

Comments

5 comments

  • Hans Merkl

    I agree about being able to view folders recursively. I also would like to be able to add folders recursively and the synchronize function to be able add/remove sub folders recursively. Deleting folders from the disk would also be a nice feature (the same way images can be deleted). 


     

    can you post the AppleScript file? I don’t have much experience with AppleScript and it would be nice to see an example for how to automate C1    . I have some other script ideas but don’t know enough about AppleScript to implement them  

     

    0
  • Quentin Black

    This is not beautifully formatted here but it may help.  I had to leverage ApplescriptObjC (ASObjC) for greater speed in searching the list of keywords as the Applescript way ('whose' clause) I could not make to work.  And it's faster...

    Good luck!

    ==============

    (* Applescipt to apply an existing Capture One keyword to the selected photos/'variants'.
    This script supplied as-is without any guarantees.  Can surely be improved upon.
    Quentin Black 2020 *)

    use AppleScript version "2.4" -- Yosemite (10.10) or later
    use scripting additions
    use framework "Foundation"
    use framework "AppKit" -- for NSEvent

    -- classes, constants, and enums used
    property NSArray : a reference to current application's NSArray
    property NSNotFound : a reference to 9.22337203685477E+18 + 5807

    property allKeywords : {}
    property allKeywordNames : {}

    tell application "Capture One 20"
    -- Hold Option key down upon execution to force re-read of all keywords
    if allKeywords is {} or my checkModifier("option") then
    tell document 1
    set allKeywords to a reference to every keyword
    -- make a parallel list of the keywords' names to populate the Choose from List dialog box
    set allKeywordNames to name of allKeywords
    end tell
    end if
    end tell

    set myNSArray to NSArray's arrayWithArray:allKeywordNames

    -- QB's custom Choose dialog
    (*)
    tell application "AS List"
    try
    activate
    choose from list allKeywordNames with title "Apply Keyword(s)"
    on error errMsg number errNum
    -- user hit Cancel; quit
    if errNum is -128 then return
    end try
    set newKeywordNames to choice of result
    end tell
    *)

    -- Using the standard 'choose from list' command from Scripting Additions:
    tell application "Capture One 20"
    choose from list allKeywordNames with title "Apply Keyword(s)" with multiple selections allowed
    set newKeywordNames to result
    if result is false then
    return
    end if
    end tell

    --get keywords of sought names the long way as 'whose' clause just doesn't work as you might expect it would...
    set keywordsToApply to {}
    repeat with aKeywordName in newKeywordNames
    -- These just don't work
    --set soughtKeyword to some item of allKeywords whose name is searchName
    --set soughtKeyword to some keyword of allKeywords whose name is searchName

    -- So convert to cocoa NSArray to get the index of the required keyword (zero-based in cocoa; 1-based in Applescript, so add 1)
    set soughtIndex to (myNSArray's indexOfObject:aKeywordName)
    if soughtIndex is not NSNotFound then
    copy item (soughtIndex + 1) of allKeywords to end of keywordsToApply
    end if
    end repeat

    tell application "Capture One 20"
    set vs to (get selected variants)
    repeat with v in vs
    -- For every selected variant, do this
    set variantKeywordNames to name of every keyword of v

    repeat with oneKeywordToApply in keywordsToApply
    -- For every keyword selected in the choose dialog, do this
    if name of oneKeywordToApply is not in variantKeywordNames then
    apply keyword oneKeywordToApply to {v}
    end if
    end repeat

    end repeat
    end tell


    -- Thanks Shane Stanley https://macscripter.net/viewtopic.php?id=42931
    on checkModifier(keyName)
    if keyName = "option" then
    set theMask to current application's NSAlternateKeyMask as integer
    else if keyName = "control" then
    set theMask to current application's NSControlKeyMask as integer
    else if keyName = "command" then
    set theMask to current application's NSCommandKeyMask as integer
    else if keyName = "shift" then
    set theMask to current application's NSShiftKeyMask as integer
    else
    return false
    end if
    set theFlag to current application's NSEvent's modifierFlags() as integer
    if ((theFlag div theMask) mod 2) = 0 then
    return false
    else
    return true
    end if
    end checkModifier

    0
  • Hans Merkl

    Thanks!

    0
  • Lily

    Hi Quentin,

     

    Thank you for feedback on Capture One - this is always welcomed and encouraged among our users and we appreciate the time you've taken to contribute towards the development of the software.

    I have forwarded your comments and suggestions to our Product Management team as something to consider in a future release.

    Whilst we cannot comment on future releases, we take all suggestions on board and hopefully your feedback contributes towards a future version of Capture One.

    0
  • Permanently deleted user

    Wow! How nice it must be to have scripting capabilities. Unfortunately the second class Windows users don't get this feature.

    Why isn't some sort of scripting available for Windows users of Capture One.  Why do we have to pay the same price for software with fewer features than the Apple version?

    A Python scripting interface would be, as they say 'da bomb.  And completely free to instantiate, less the labor to do so.

    H'mmm.....

    0

Post is closed for comments.