├── .gitignore ├── README.md ├── add-border ├── README.md └── add_border.applescript ├── back-to-raw ├── Installer.applescript └── README.md ├── clear-batch-queue ├── Installer.applescript └── README.md ├── copy-labels-to-finder ├── Installer.applescript └── README.md ├── delete-selected-layers ├── Installer.applescript └── README.md ├── dt-on-set-scripts ├── Capture One Scripts │ ├── add_capture_to_favs.applescript │ ├── apply_keywords.applescript │ ├── batch_rename_collection.applescript │ ├── make_new_dir.applescript │ ├── select_next_capture.applescript │ ├── select_previous_capture.applescript │ └── smart_album_for_selection.applescript ├── LICENSE ├── README.md └── install.command ├── find-offline-files ├── CO_Find_Offline_Image_Files_1300_Flat.applescript └── README.md ├── label-untitled-variants ├── Installer.applescript └── README.md ├── library └── COscriptlibrary.applescript ├── location-from-gps ├── Installer.applescript └── README.md ├── managed-to-referenced ├── Installer.applescript └── README.md ├── monochrome-keywords ├── Installer.applescript └── README.md ├── search-by-month ├── Installer.applescript └── README.md ├── select-image-layer ├── Installer.applescript └── README.md ├── settings-export-import ├── Installer.applescript └── README.md ├── sync-layer-adjustments ├── Installer.applescript └── README.md ├── template ├── AppTemplate.applescript └── README.md └── time-lapse-smoothing ├── Installer.applescript └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | *untracked 3 | 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Capture One Scripts 2 | 3 | This repository is a collection of user-contributed scripts for the Capture One Pro raw editor from PhaseOne. The scripts hosted in this collection are owned by their respective contributors who have sole governance and responsibility over their copyrights. This repository has no official affiliation with or sponsorship from PhaseOne or Capture One. 4 | 5 | ## The Scripts 6 | 7 | Brief summary of the available scripts. Details provided in the README files in the script directories. 8 | 9 | * **[Add Border](add-border/)** - Add borders to exported images. Works in Process Recipes using Open With, or in macOS Finder. 10 | * **[Back To Raw](back-to-raw/)** - synchronize one or more of adjustments, ratings, labels, keywords, metadata from a source file type to target file types. 11 | * **[Clear Batch Queue](clear-batch-queue/)** - empty batch queue, delete old batch folders, and clean out current batch queue folder. 12 | * **[Copy Labels to Finder](copy-labels-to-finder/)** - copy capture one color tags to macos finder color labels. 13 | * **[Delete Selected Layers](delete-selected-layers/)** - delete selected layers from multiple variants. 14 | * **[dt-on-set-scripts](dt-on-set-scripts/)** - A collection of scripts for DigiTechs to use on set via keyboard shortcuts. 15 | * **[Export / Import Settings](settings-export-import/)** - Export / Import your Capture One presets, styles, export recipes, etc. 16 | * **[find-offline-files](find-offline-files/)** - Find all offline files in a catalog. 17 | * **[Label Untitled Variants](label-untitled-variants/)** - add blue color label to variants with empty iptc title. 18 | * **[Location From GPS](location-from-gps/)** - look up city, county, state, country, country code from gps data and apply as hierarchical keyword and IPTC metadata. 19 | * **[Managed to Referenced](managed-to-referenced/)** - move managed images in a catalog to referenced date-based folders. 20 | * **[Monochrome Keywords](monochrome-keywords/)** - apply monochrome keywords to or remove monochrome keywords from images. 21 | * **[Smart Album Search by Month](search-by-month/)** - create a smart album to search for images created in the same month across a range of years. 22 | * **[Select Image Layer](select-image-layer/)** - set current layer of selected variants (or all of none selected) to background (image layer). 23 | * **[Synchronize Layers](sync-layer-adjustments/)** - synchronize adjustments between two layers across images, or sync one layer's adjustments to multiple images. 24 | * **[Time Lapse Smoothing](time-lapse-smoothing/)** - Smooth the exposure and white balance temperature progression across every exposure set of a full time lapse sequence. 25 | 26 | ## Warranty 27 | 28 | These scripts are offered freely and without warranty. Use them at your own discretion. 29 | 30 | The contributors test their scripts to the best of their ability. Any errors or issues discovered should be reported by adding issues to this project. Please include the script name in the issue title, describe the issue in text as completely as you can, and attach screen shots or links to video recordings where possible. 31 | 32 | ## Contributors 33 | 34 | * [Emory Dunn](https://github.com/emorydunn/CaptureOneScripts) 35 | * [Eric Valk](https://github.com/EricNepean) 36 | * [Rick Allen](https://github.com/rick-allen) 37 | * [Walter Rowe](https://github.com/walterrowe) 38 | 39 | ## Other Script Repositories 40 | 41 | - Dozer Labs - https://github.com/dozer-labs/basics 42 | - MagickFrames - https://github.com/walterrowe/magick-frames 43 | -------------------------------------------------------------------------------- /add-border/README.md: -------------------------------------------------------------------------------- 1 | # add-border 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | macOS AppleScript to add borders to image files. This works as a droplet with macOS Finder or with Capture One Pro when added to the Open With field in Output Recipes. 8 | 9 | ## How To Use This 10 | 11 | ### Create an app from this script 12 | 13 | 1. Open add_border.scpt in ScriptEditor 14 | 2. File > Export and save in a place where you can reference it 15 | * File Format: Application 16 | 17 | ### Use with macOS Finder 18 | 19 | 1. Select image files in Finder 20 | 2. Drag-n-drop selected files onto add_border droplet 21 | 22 | ### Use with Capture One 23 | 24 | 1. Go to `Open With` field in a Capture One Process Recipe 25 | 2. Choose `Other` from the `Open With` drop-down menu 26 | 3. Navigate to and select your add_border droplet 27 | 4. Select Process Recipe 28 | 5. Select images to process 29 | 6. Process images (`CMD-d`) 30 | 31 | ### Change Border Size 32 | 33 | Look at comments inside the AppleScript code to see where you can change the border styles. You can create multiple apps from this same script. Simply modify the border code to your liking inside the script and export it as a new app with an appropriate name. Each app you create will add the border you coded into the script when you saved it. If you don't like what you created, just delete the exported app and create a new one. 34 | 35 | Example ideas might be: 36 | 37 | * add\_border\_10 – add a 10-pixel border 38 | * add\_border\_20 – add a 20-pixel border 39 | * add\_border\_black – add a black border with inner white border 40 | * add\_border\_white – add a white border with inner black border 41 | 42 | You can create different Process Recipes in Capture One that reference the different apps you created, or you can use macOS Finder to drag-n-drop selected images onto the app version that adds the border you desire. 43 | 44 | ## macOS Catalina Changes 45 | 46 | macOS Catalina introduces new levels of security to protect your system from unwanted access to your files. This change requires that you to grant explicit access to your files and folders. The add_border droplet uses the Image Event core service to modify the border of the selected image files. We therefore need to grant Full Disk access to the Image Event service so it can read and write your image files. 47 | 48 | This information was documented in [this article](https://darjeelingsteve.com/articles/Fixing-%22Image-Events%22-AppleScripts-Broken-in-macOS-10.15-Catalina.html) written by Steve Anthony. 49 | 50 | 1. Open System Preferences 51 | 2. Go to Security & Privacy 52 | 3. Click the Lock icon to unlock the panel 53 | 4. Click the Privacy tab at the top 54 | 5. Scroll down to and select Full Disk Access 55 | 6. In the right side click the "+" button 56 | 7. In the navigator popup, select the following: 57 | * Macintosh HD > System > Library > CoreServices > Image Events 58 | 8. Press the Open button in the bottom right corner 59 | 60 | This should add the Image Events service to the list of apps with Full Disk Access permissions. 61 | 62 | ## Origins 63 | 64 | This script originates from Apple’s Recursive Image File Processing Droplet template. You can read more about it in the [Mac Automation Scripting Guide to Process Dropped Files and Folders](https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/ProcessDroppedFilesandFolders.html). It formats and executes terminal `sips` command to edit the selected image files. 65 | 66 | 1. Open Apple ScriptEditor 67 | 2. Navigate to menu option File > New from Template > Droplets > Recursive Image File Processing Droplet 68 | 69 | ## ChangeLog 70 | 71 | | Role | Name | Year | 72 | | ---: | :--- | ---: | 73 | | Original | Kim Aldis | 2016 | 74 | | Modified | Walter Rowe | 2022 | 75 | -------------------------------------------------------------------------------- /add-border/add_border.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | Original: Kim Aldis 2016 3 | Modified: Walter Rowe 2022 4 | Source: https://github.com/walterrowe/add_border 5 | *) 6 | 7 | (* TO FILTER FOR IMAGE FILES, LOOK FOR QUICKTIME SUPPORTED IMAGE FORMATS *) 8 | property type_list : {"JPEG", "TIFF", "PNGf", "8BPS", "BMPf", "GIFf", "PDF ", "PICT"} 9 | property extension_list : {"jpg", "jpeg", "tif", "tiff", "png", "psd", "bmp", "gif", "jp2", "pdf", "pict", "pct", "sgi", "tga"} 10 | property typeIDs_list : {"public.jpeg", "public.tiff", "public.png", "com.adobe.photoshop-image", "com.microsoft.bmp", "com.compuserve.gif", "public.jpeg-2000", "com.adobe.pdf", "com.apple.pict", "com.sgi.sgi-image", "com.truevision.tga-image"} 11 | property padding : 4 --set interior border width to 2 pixel on each side - total of 4 pixels 12 | 13 | on open these_items 14 | repeat with this_item in these_items 15 | set item_info to info for this_item 16 | 17 | (* get the properties of the current file we are processing as an array theoretically faster *) 18 | try 19 | set {this_filename, this_extension, this_filetype, this_typeID} to {name, name extension, file type, type identifier} of item_info 20 | on error 21 | set {this_filename, this_extension, this_filetype, this_typeID} to {"", "", "", ""} 22 | end try 23 | 24 | (* get the POSIX path of the current file we are processing *) 25 | set this_path to quoted form of POSIX path of this_item 26 | 27 | (* only process if we support the image type *) 28 | if ((this_filetype is in type_list) or (this_extension is in extension_list) or (this_typeID is in typeIDs_list)) then 29 | try 30 | 31 | (* GET ORIGINAL DIMENSIONS IN PIXELS *) 32 | 33 | (* extract the x/y dimensions in pixels *) 34 | set theRes to (do shell script (("sips -g pixelHeight -g pixelWidth " & this_path as string) & " | tail -2")) 35 | set {y, x} to {last word of first paragraph, last word of last paragraph} of theRes 36 | 37 | (* display dialog "Original Resolution: " & (x as string) & " x " & (y as string) & " pixels" *) 38 | 39 | (* ADD INNER BORDER *) 40 | 41 | (* SET NEW DIMENSIONS TO INCLUDE INNER BORDER WIDTH *) 42 | (* set absolute image width and height to include interior white border edge *) 43 | 44 | set pixelHeight to y + padding 45 | set pixelWidth to x + padding 46 | 47 | (* display dialog "Resolution w/ Inner Border: " & (pixelWidth as integer as string) & " x " & (pixelHeight as integer as string) & " pixels" *) 48 | 49 | (* RESIZE TO NEW DIMENSIONS AND ADD INNER BORDER with padColor *) 50 | (* padColor ffffff is white, 000000 is black *) 51 | (* increase image dimensions by 'padding' pixels to add white border *) 52 | 53 | try 54 | do shell script "sips " & this_path & " -p " & (pixelHeight as integer) & " " & (pixelWidth as integer) & " --padColor ffffff -i" 55 | on error errStr number errorNumber 56 | display dialog "Droplet ERROR: " & errStr & ": " & (errorNumber as text) & "on file " & this_filename 57 | end try 58 | 59 | 60 | (* ADD OUTER BORDER *) 61 | 62 | (* CALCULATE OUTER BORDER WIDTH *) 63 | (* this uses shortest edge to calculate 4% border width (based on padding = 4 at the top), swap the two formulas to use longest edge *) 64 | 65 | if x is greater than y then -- set outer border width to 4% of shortest edge in pixels 66 | set border to padding + (padding / 100 * y) 67 | else 68 | set border to padding + (padding / 100 * x) 69 | end if 70 | 71 | (* SET NEW DIMENSIONS TO INCLUDE OUTER BORDER WIDTH *) 72 | (* now set absolute image width and height to include black border *) 73 | 74 | set pixelHeight to y + border 75 | set pixelWidth to x + border 76 | 77 | (* display dialog "Resolution w/ Outer Border: " & (pixelWidth as integer as string) & " x " & (pixelHeight as integer as string) & " pixels" *) 78 | 79 | (* RESIZE TO NEW DIMENSIONS AND ADD OUTER BORDER with padColor *) 80 | (* increase image dimensions by 'padding' pixels to add black border *) 81 | (* padColor ffffff is white, 000000 is black *) 82 | 83 | set theSIP to do shell script "sips " & this_path & " -p " & (pixelHeight as integer) & " " & (pixelWidth as integer) & " --padColor 000000 -i" 84 | 85 | on error errStr number errorNumber 86 | display dialog "Droplet ERROR: " & errStr & ": " & (errorNumber as text) & "on file " & this_filename 87 | end try 88 | 89 | end if 90 | end repeat 91 | end open 92 | -------------------------------------------------------------------------------- /back-to-raw/Installer.applescript: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/walterrowe/capture-one-scripts/ee494a8fc2cd3c29a30aa098c2149bda38788f70/back-to-raw/Installer.applescript -------------------------------------------------------------------------------- /back-to-raw/README.md: -------------------------------------------------------------------------------- 1 | # BACK To RAW 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | The purpose of this script is to synchronize all or a subset of adjustments, metadata, keywords, ratings, and labels from a chosen source file type to one or more chosen target file types. For example, a client could apply labels and star ratings to JPGs you provided as proofs. With this script you can synchronize these back to your original source raw files. 8 | 9 | The genesis of this script was me finding thousands of camera native raw files on old disks that I had long ago converted to Adobe DNG format. I wanted to migrate all of the adjustments, metadata, keywords, ratings, and labels from the Adobe DNG files back to their original camera native raw files recovered from the old disk drive. Manually pairing up DNG and RAW files, and manually syncing all of these attributes would be an overwhelming task. It would be much faster if I could select a batch of picture sets and let a script pair them up and perform this synchronization. It would take a fraction of the time and I could let it run while I do other tasks. 10 | 11 | ## Special Note 12 | 13 | Capture One appears to use the EXIF CreateDate tag value for image date in its metadata. Adobe DNG files derived from camera native raw files via Adobe DNG Converter or Adobe Photoshop Lightroom® may have the DNG file's create date stored in the CreateDate tag's value instead of the original camera native raw file's DateTimeOriginal value. Since Capture One provides no method of accessing DateTimeOriginal value the AppKit framework is used to get the value. The value is used to match source and target images by date/time/fraction of a second. Selected files that do not have the DateTimeOriginal metadata will be excluded from the process. 14 | 15 | The date/time comparison used by this utility attempts to be accurate down to the fraction of a second ("YYYY:MM:DD HH:MM:SS.hh" where "hh" is hundredths of a second). Some image files may not include the ` Sub Sec Time Original ` tag. In that instance only the "YYYY:MM:DD HH:MM:SS" will be used to match source and target images. When no sub second data is available only the first of multiple target images with the same "YYYY:MM:DD HH:MM:SS" date/time stamp will be matched to a given source image. 16 | 17 | ## Prerequisites 18 | 19 | This utility previously required ` exiftool ` to extract the DateTimeOriginal EXIF tag. Credit to [Shane Stanley on macscripter.net](https://www.macscripter.net/t/getting-exif-metadata-from-image-files/69297/6) for providing a native AppleScript method via the AppKit framework. 20 | 21 | ## Installation 22 | 23 | The script self-installs in your Capture One Scripts folder. 24 | 25 | 1. Open the AppleScript file in macOS Script Editor. 26 | 1. Click the "Run this script" (▶) button. 27 | 1. Open Capture One and choose Scripts > Update Script Menu. 28 | 1. You now can run the script from the Capture One Scripts menu. 29 | 30 | ## How To Use 31 | 32 | Select a batch of pictures in Capture One and run the script. Choose the source file extension, choose one or more target file extensions, and choose what attributes you want to sychronize. After confirming your choices, the script will search the selection for matching pairs of files between source and target extensions. When matching pairs are found, it will copy your chosen attributes from the source file to the matching target file(s). 33 | 34 | - Do not include 'Crop' when source and targets differ in dimensions or you get undesirable crops on the targets. 35 | - Matched pairs of files will be added to a User Collection called "BACK-to-RAW Matched Variants". 36 | - Skipped files will be added to a User Collection called "BACK-to-RAW Skipped Variants". 37 | 38 | When the run is complete a status message will pop up showing how many variants were skipped and how many pairs were synchronized. 39 | 40 | ## Compatibility 41 | 42 | The utility has been tested on: 43 | 44 | - macOS Sonoma (Intel and M3 MacBook Pro) 45 | - Capture One 16.4 46 | 47 | ## ChangeLog 48 | 49 | - 13 Aug 2024 - enhanced installer and requirements checks 50 | -------------------------------------------------------------------------------- /clear-batch-queue/Installer.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | AUTHOR 3 | 4 | Author: Walter Rowe 5 | Contact: walter@walterrowe.com 6 | 7 | Created: 08-Aug-2024 8 | Updated: 20-Aug-2024 9 | 10 | DESCRIPTION 11 | 12 | Clear the batch queue and clean up the batch queue folder(s) 13 | 14 | PREREQUISITES 15 | 16 | *) 17 | 18 | use AppleScript version "2.8" 19 | use scripting additions 20 | 21 | property libraryFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/" 22 | property installFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/Capture One Scripts/" 23 | 24 | property installNames : {"Clear Batch Queue"} 25 | property installType : ".scpt" 26 | property installIcon : false -- if true there must be a droplet.icns icon file in the source folder 27 | 28 | property requiresCOrunning : true -- true if capture one is required to be running 29 | property requiresCOdocument : true -- true if capture one is required to have an open document 30 | 31 | property appTesting : false -- if true, run in script editor, and if false install the script 32 | 33 | -- application specific properties below 34 | 35 | property queueParent : ((POSIX path of (path to home folder)) as string) & "Library/Application Support/Capture One/" 36 | 37 | -- application specific properties above 38 | 39 | on run 40 | 41 | -- set required base variables 42 | set appName to my name 43 | set appPath to path to me 44 | 45 | -- make sure the CO script library is loaded 46 | set myLibrary to loadLibrary(appName) 47 | if myLibrary is missing value then return 48 | 49 | -- do install if not running under app name 50 | if installNames does not contain appName and not appTesting then 51 | myLibrary's installMe(appName, appPath, installFolder, installType, installNames, installIcon) 52 | return 53 | end if 54 | 55 | -- if app testing and we have multiple install names choose what action to perform 56 | if appTesting is true then 57 | if (count of installNames) > 1 then 58 | set appName to choose from list installNames with prompt "Choose Target Layer To Sync" 59 | if appName is false then return 60 | set appName to first item of appName 61 | else 62 | set appName to item 1 of installNames 63 | end if 64 | end if 65 | 66 | -- verify Capture One is running and has a document open 67 | set readyToRun to myLibrary's meetsRequirements(appName, requiresCOrunning, requiresCOdocument) 68 | if not readyToRun then return 69 | 70 | -- get path to Capture One's app icon 71 | set coIcon to path to resource "AppIcon.icns" in bundle (path to application "Capture One") 72 | 73 | -- ensure we have permission to interact with other apps 74 | myLibrary's activateUIScripting() 75 | 76 | -- application code goes below here 77 | 78 | -- get contents of all batch queue folders 79 | tell application "Capture One" to tell current document to set batchEnabled to processing queue enabled 80 | tell application "Capture One" to tell current document to set batchCount to count of every job 81 | if batchEnabled is true then 82 | set batchEnabled to "Started" 83 | else 84 | set batchEnabled to "Stopped" 85 | end if 86 | 87 | set queueMessage to "" 88 | 89 | tell application "Finder" 90 | set queueAlias to (queueParent as POSIX file as alias) 91 | set queueFolders to ((every item of folder queueAlias where name starts with "Batch") sort by name) 92 | set queueFiles to {} 93 | set queueSizes to {} 94 | set queueTotalFiles to 0 95 | set queueTotalSizes to 0 96 | repeat with idx from 1 to count of queueFolders 97 | 98 | set theFolder to queueParent & name of item idx of queueFolders as POSIX file as alias 99 | 100 | set end of queueFiles to (count of every item of folder theFolder) as string 101 | 102 | set theFiles to size of every item of folder theFolder 103 | 104 | set folderSize to 0 105 | repeat with fileIndex from 1 to count of theFiles 106 | set folderSize to folderSize + (item fileIndex of theFiles) 107 | end repeat 108 | 109 | set queueTotalFiles to queueTotalFiles + (count of theFiles) 110 | set queueTotalSizes to queueTotalSizes + folderSize 111 | 112 | set end of queueFiles to (count of theFiles) as string 113 | set end of queueSizes to folderSize 114 | 115 | set queueMessage to (queueMessage & (((name of item idx of queueFolders & " (" & item idx of queueFiles as string) & " files, " & ((item idx of queueSizes) / 1024 / 1024 as integer) as string) & "MB)") & return) 116 | 117 | end repeat 118 | end tell 119 | 120 | set alertMessage to ((queueMessage & return & "Total Space: " & queueTotalFiles as string) & " files, " & (queueTotalSizes / 1024 / 1024 as integer) & "MB" & return & return & "Batch Queue: " & batchEnabled & " (" & batchCount as string) & " jobs)" & return 121 | 122 | -- inform user of what we plan to do and offer to cancel or continue 123 | try 124 | set alertResult to (display alert appName message "This utility requires a Capture One session or catalog to be open." & return & return & "It stops the batch queue, removes all existing jobs from the queue, moves older batch queue folders to system trash, and moves the contents of the current batch queue folder to system trash." & return & return & alertMessage & return & "Do you wish to Cancel or Continue?" as informational buttons {"Cancel", "Continue"} cancel button "Cancel" giving up after 30) 125 | if (gave up of alertResult) or (button returned of alertResult is "Cancel") then return 126 | on error 127 | -- graceful exit when user presses Cancel 128 | return 129 | end try 130 | 131 | -- the user has agreed to continue 132 | 133 | -- delete all existing jobs in the batch queue 134 | tell application "Capture One" 135 | tell current document 136 | set queueEnabled to processing queue enabled 137 | set processing queue enabled to false 138 | delete every job 139 | set processing queue enabled to queueEnabled 140 | end tell 141 | end tell -- Capture One 142 | 143 | -- delete older queue folders and current queue folder contents 144 | tell application "Finder" 145 | set folderCount to count of queueFolders 146 | repeat with idx from 1 to folderCount 147 | set theFolder to queueParent & name of item idx of queueFolders as POSIX file as alias 148 | if idx < folderCount then 149 | delete folder theFolder 150 | else 151 | delete every item of folder theFolder 152 | end if 153 | end repeat 154 | end tell 155 | 156 | tell application "Capture One" to tell current document to set batchCount to count of every job 157 | 158 | set alertTitle to appName & " Finished" 159 | set alertMessage to ((queueMessage & return & "Total Space: " & queueTotalFiles as string) & " files, " & (queueTotalSizes / 1024 / 1024 as integer) & "MB" & return & return & "Batch Queue: " & batchEnabled & " (" & batchCount as string) & " jobs)" & return 160 | 161 | -- application code goes above here 162 | 163 | set alertResult to (display alert alertTitle message alertMessage buttons {"OK"} giving up after 10) 164 | 165 | end run 166 | 167 | ## 168 | ## download and install the latest CO script library 169 | ## 170 | 171 | on loadLibrary(appName as string) 172 | 173 | set myLibrary to libraryFolder & "COscriptlibrary.scpt" 174 | 175 | tell application "Finder" 176 | set libraryDownload to "curl -s -f https://raw.githubusercontent.com/walterrowe/capture-one-scripts/master/library/COscriptlibrary.applescript -o COscriptlibrary.applescript --output-dir " & libraryFolder 177 | set libraryCompile to "osacompile -x -o " & (quoted form of myLibrary) & " " & libraryFolder & "COscriptlibrary.applescript" 178 | try 179 | do shell script libraryDownload 180 | do shell script libraryCompile 181 | on error errorText 182 | -- failed to download and compile the latest library 183 | -- if we have a copy of the library installed then use it 184 | try 185 | exists (POSIX file myLibrary as alias) 186 | on error 187 | set myLibrary to POSIX path of myLibrary 188 | set alertResult to (display alert appName message "Unable to download and compile script library " & myLibrary & return & return & libraryDownload & return & return & libraryCompile & return & return & errorText buttons {"Quit"} giving up after 30) 189 | return missing value 190 | end try 191 | end try 192 | end tell 193 | 194 | try 195 | set myLibrary to load script myLibrary 196 | return myLibrary 197 | on error 198 | set myLibrary to POSIX path of myLibrary 199 | set alertResult to (display alert appName message "Unable to load script library " & myLibrary buttons {"Quit"} giving up after 30) 200 | return missing value 201 | end try 202 | 203 | end loadLibrary 204 | -------------------------------------------------------------------------------- /clear-batch-queue/README.md: -------------------------------------------------------------------------------- 1 | # Clear Batch Queue 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | This AppleScript utility helps keep the batch queue and its corresponding folder clean. 8 | 9 | - deletes all the jobs in the current batch job queue 10 | - moves batch queue folders from prior versions to System Trash 11 | - moves contents of the current batch queue folder to System Trash 12 | 13 | When run from Capture One's Script menu this utility first displays the names, number of files, and size in MB of each batch queue folder found. It may take some time for this screen to appear because it examines every file in every batch queue folder to ensure it gets an accurate space consumed for each folder. 14 | 15 | It then asks the user for confirmation to continue or to exit. 16 | 17 | - If the user continues, the above actions are taken. 18 | - If the user chooses to exit, no action is taken. 19 | 20 | Some items to note: 21 | 22 | - The batch history will not reflect being empty until Capture One is restarted. 23 | - You may have to enable Extensions in System Settings. 24 | 25 | ## Prerequisites 26 | 27 | None 28 | 29 | # Installation 30 | 31 | The script self-installs in your Capture One Scripts folder. 32 | 33 | 1. Open the AppleScript file in macOS Script Editor. 34 | 1. Click the "Run this script" (▶) button. 35 | 1. Open Capture One and choose Scripts > Update Script Menu. 36 | 1. You now can run the script from the Capture One Scripts menu. 37 | 38 | ## Compatibility 39 | 40 | The utility has been tested on: 41 | 42 | - macOS Sonoma (Intel and M3 MacBook Pro) 43 | - Capture One 16.4 44 | 45 | ## ChangeLog 46 | 47 | - 13 Aug 2024 - enhanced installer and requirements checks 48 | - 08 Aug 2024 - initial version 49 | -------------------------------------------------------------------------------- /copy-labels-to-finder/Installer.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | AUTHOR 3 | 4 | Author: Walter Rowe 5 | Contact: walter@walterrowe.com 6 | 7 | Created: 12-August-2023 8 | Updated: 20-August-2024 9 | 10 | DESCRIPTION 11 | 12 | Apply Capture One color tags as color labels of corresponding files in macOS Finder 13 | 14 | PREREQUISITES 15 | 16 | None 17 | *) 18 | 19 | use AppleScript version "2.8" 20 | use scripting additions 21 | 22 | property libraryFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/" 23 | property installFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/Capture One Scripts/" 24 | 25 | property installNames : {"Copy Labels To Finder"} 26 | property installType : ".scpt" 27 | property installIcon : false 28 | 29 | property requiresCOrunning : true 30 | property requiresCOdocument : true 31 | 32 | property appTesting : false 33 | 34 | -- application specific properties below 35 | 36 | property docType : "catalog" as string 37 | property labelMapping : {2, 1, 3, 6, 4, 7, 5} 38 | 39 | -- application specific properties above 40 | 41 | on run 42 | 43 | -- set required base variables 44 | set appName to my name 45 | set appPath to path to me 46 | 47 | -- make sure the CO script library is loaded 48 | set myLibrary to loadLibrary(appName) 49 | if myLibrary is missing value then return 50 | 51 | -- do install if not running under app name 52 | if installNames does not contain appName and not appTesting then 53 | myLibrary's installMe(appName, appPath, installFolder, installType, installNames, installIcon) 54 | return 55 | end if 56 | 57 | -- if app testing and we have multiple install names choose what action to perform 58 | if appTesting is true then 59 | if (count of installNames) > 1 then 60 | set appName to choose from list installNames with prompt "Choose Target Layer To Sync" 61 | if appName is false then return 62 | set appName to first item of appName 63 | else 64 | set appName to item 1 of installNames 65 | end if 66 | end if 67 | 68 | -- verify Capture One is running and has a document open 69 | set readyToRun to myLibrary's meetsRequirements(appName, requiresCOrunning, requiresCOdocument) 70 | if not readyToRun then return 71 | 72 | -- get path to Capture One's app icon 73 | set coIcon to path to resource "AppIcon.icns" in bundle (path to application "Capture One") 74 | 75 | -- ensure we have permission to interact with other apps 76 | myLibrary's activateUIScripting() 77 | 78 | -- application code goes below here 79 | 80 | tell application "Capture One" 81 | set startTime to current date 82 | set imageSel to get selected variants 83 | 84 | if (count of imageSel) < 1 then 85 | set alertResult to (display alert appName message "No images are selected." buttons {"Stop"} default button "Stop" as critical giving up after 10) 86 | return 87 | end if 88 | 89 | set noLabels to {} 90 | tell me to myLibrary's progress_start(0, "Processing ...", "scanning") 91 | set imgCount to count of imageSel 92 | set imgsUpdated to 0 93 | repeat with i from 1 to imgCount 94 | tell me to myLibrary's progress_update(i, imgCount, "") 95 | set thisVariant to item i of imageSel 96 | set thisFile to file of parent image of thisVariant as alias 97 | set thisLabel to color tag of thisVariant 98 | 99 | -- map capture one color tags to macOS finder label indexes 100 | -- color CO-index Finder-index 101 | -- 102 | -- None 0 0 103 | -- Red 1 2 104 | -- Orange 2 1 105 | -- Yellow 3 3 106 | -- Green 4 6 107 | -- Blue 5 4 108 | -- Pink 6 7 (CO pink maps to Finder gray) 109 | -- Purple 7 5 110 | -- 111 | -- use CO's label number as index into list for macOS label numbers 112 | -- omit 0 since it maps 1-to-1 and there is not item 0 in applescript lists 113 | -- { 1, 2, 3, 4, 5, 6, 7 } 114 | -- { 2, 1, 3, 6, 4, 7, 5 } 115 | 116 | -- 0 and 3 map to the same number 117 | if thisLabel is not in {0, 3} then 118 | set thisLabel to item thisLabel of labelMapping 119 | end if 120 | 121 | tell application "Finder" to set label index of thisFile to thisLabel 122 | tell me to myLibrary's progress_step(i) 123 | end repeat 124 | 125 | tell me to myLibrary's progress_end() 126 | 127 | tell me to set noLabelsCount to ((count of noLabels) as string) 128 | tell me to set timeTaken to ((current date) - startTime) 129 | set timeTaken to ((timeTaken / 60 as integer) as string) & ":" & (text -1 thru -2 of ("0" & (timeTaken mod 60 as integer) as string)) 130 | 131 | 132 | end tell 133 | 134 | set alertMessage to "Updated " & imgCount & " images in " & timeTaken & " (mm:ss)." 135 | 136 | -- application code goes above here 137 | 138 | set alertTitle to appName & " Finished" 139 | 140 | set alertResult to (display alert alertTitle message alertMessage buttons {"OK"} giving up after 10) 141 | 142 | end run 143 | 144 | ## 145 | ## download and install the latest CO script library 146 | ## 147 | 148 | on loadLibrary(appName as string) 149 | 150 | set myLibrary to libraryFolder & "COscriptlibrary.scpt" 151 | 152 | tell application "Finder" 153 | set libraryDownload to "curl -s -f https://raw.githubusercontent.com/walterrowe/capture-one-scripts/master/library/COscriptlibrary.applescript -o COscriptlibrary.applescript --output-dir " & libraryFolder 154 | set libraryCompile to "osacompile -x -o " & (quoted form of myLibrary) & " " & libraryFolder & "COscriptlibrary.applescript" 155 | try 156 | do shell script libraryDownload 157 | do shell script libraryCompile 158 | on error errorText 159 | -- failed to download and compile the latest library 160 | -- if we have a copy of the library installed then use it 161 | try 162 | exists (POSIX file myLibrary as alias) 163 | on error 164 | set myLibrary to POSIX path of myLibrary 165 | set alertResult to (display alert appName message "Unable to download and compile script library " & myLibrary & return & return & libraryDownload & return & return & libraryCompile & return & return & errorText buttons {"Quit"} giving up after 30) 166 | return missing value 167 | end try 168 | end try 169 | end tell 170 | 171 | try 172 | set myLibrary to load script myLibrary 173 | return myLibrary 174 | on error 175 | set myLibrary to POSIX path of myLibrary 176 | set alertResult to (display alert appName message "Unable to load script library " & myLibrary buttons {"Quit"} giving up after 30) 177 | return missing value 178 | end try 179 | 180 | end loadLibrary 181 | -------------------------------------------------------------------------------- /copy-labels-to-finder/README.md: -------------------------------------------------------------------------------- 1 | # Copy Labels to Finder 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | This AppleScript script copies color tags (labels) from Capture One variants to their corresponding files in macOS Finder. 8 | 9 | If you select more than one variant of an image then only the last variant's color tag will be reflected in macOS Finder. Every variant of an image in Capture One refers to the same image file on disk. 10 | 11 | The Capture One color tag PINK is mapped to the macOS Finder color tag GRAY. 12 | 13 | | Color Tag Name | Capture One Color Tag Index | macOS Finder Color Tag Index | 14 | | ---: | :--: | :--: | 15 | | None | 0 | 0 | 16 | | Red | 1 | 2 | 17 | | Orange | 2 | 1 | 18 | | Yellow | 3 | 3 | 19 | | Green | 4 | 6 | 20 | | Blue | 5 | 4 | 21 | | Pink
(GRAY in Finder) | 6 | 7 | 22 | | Purple | 7 | 5 | 23 | 24 | ## Prerequisites 25 | 26 | None 27 | 28 | ## Installation 29 | 30 | The script self-installs in your Capture One Scripts folder. 31 | 32 | 1. Open the AppleScript file in macOS Script Editor. 33 | 1. Click the "Run this script" (▶) button. 34 | 1. Open Capture One and choose Scripts > Update Script Menu. 35 | 1. You now can run the script from the Capture One Scripts menu. 36 | 37 | ## How To Use 38 | 39 | 1. Open your Capture One session or catalog. 40 | 2. Select the images in Capture One you want to sync to Finder. 41 | 3. Choose "Copy Labels To Finder" from the Scripts menu. 42 | 43 | ## Compatibility 44 | 45 | The utility has been tested on: 46 | 47 | - macOS Sonoma (Intel and M3 MacBook Pro) 48 | - Capture One 16.4 49 | 50 | ## ChangeLog 51 | 52 | - 13 Aug 2024 - enhanced installer and requirements checks 53 | -------------------------------------------------------------------------------- /delete-selected-layers/Installer.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | AUTHOR 3 | 4 | Author: Walter Rowe 5 | Contact: walter@walterrowe.com 6 | 7 | Created: 25-Oct-2024 8 | Updated: 9 | 10 | 1. Set installNames 11 | 2. Develop code 12 | 3. Provide app icon (optional, set installIcon to true) 13 | 4. Test code in Script Editor 14 | 5. Change appTesting to false 15 | 6. Test code in Capture One 16 | 17 | DESCRIPTION 18 | 19 | Lets a user delete a layer(s) from layer names identified in selected images. 20 | 21 | PREREQUISITES 22 | 23 | None 24 | *) 25 | 26 | property version : "1.0" 27 | 28 | use AppleScript version "2.8" 29 | use scripting additions 30 | 31 | property libraryFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/" 32 | property installFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/Capture One Scripts/" 33 | 34 | property installNames : {"Delete Selected Layers"} 35 | property installType : ".scpt" -- ".scpt" for script, ".app" for script app 36 | property installIcon : false -- if true must have a droplet.icns icon file in the source folder and ".app" installType 37 | 38 | property requiresCOrunning : true -- true if capture one is required to be running 39 | property requiresCOdocument : true -- true, false, "catalog", "session" 40 | 41 | property appTesting : false -- if true, run in script editor, and if false install the script 42 | 43 | -- application specific properties below -- properties are constants at compile time 44 | 45 | -- application specific properties above -- properties are constants at compile time 46 | 47 | ## 48 | ## use this to handle typical running from Capture One Scripts menu 49 | ## 50 | 51 | on run 52 | 53 | -- set required base variables 54 | set appName to my name 55 | set appPath to path to me 56 | 57 | -- make sure the CO script library is loaded 58 | set myLibrary to loadLibrary(appName) 59 | if myLibrary is missing value then return 60 | 61 | -- do install if not running under app name 62 | if installNames does not contain appName and not appTesting then 63 | myLibrary's installMe(appName, appPath, installFolder, installType, installNames, installIcon) 64 | return 65 | end if 66 | 67 | -- if app testing and we have multiple install names choose what action to perform 68 | if appTesting is true then 69 | if (count of installNames) > 1 then 70 | set appName to choose from list installNames with prompt "Choose Target Layer To Sync" 71 | if appName is false then return 72 | set appName to first item of appName 73 | else 74 | set appName to item 1 of installNames 75 | end if 76 | end if 77 | 78 | -- verify Capture One is running and has a document open 79 | set readyToRun to myLibrary's meetsRequirements(appName, requiresCOrunning, requiresCOdocument) 80 | if not readyToRun then return 81 | 82 | -- get path to Capture One's app icon 83 | set coIcon to path to resource "AppIcon.icns" in bundle (path to application "Capture One") 84 | 85 | -- ensure we have permission to interact with other apps 86 | myLibrary's activateUIScripting() 87 | 88 | -- application code goes below here 89 | 90 | tell application "Capture One" 91 | set docKind to myLibrary's getCOtype(current document) 92 | tell current document to set docName to name 93 | tell current document to set docPath to POSIX path of (path as alias) as string 94 | end tell 95 | 96 | tell application "Capture One" 97 | set layerNames to {} 98 | set theVariants to selected variants 99 | 100 | -- collect names of layers from all selected variants 101 | repeat with theVariant in theVariants 102 | repeat with theLayer in every layer of theVariant 103 | if layerNames does not contain name of theLayer then 104 | set end of layerNames to name of theLayer 105 | end if 106 | end repeat 107 | end repeat 108 | 109 | -- sort layer names 110 | set layerNames to myLibrary's sortList(layerNames) 111 | 112 | -- choose names of layers to delete 113 | set layerNamesToDelete to choose from list layerNames with prompt "Choose One Or More Layer To Delete" with multiple selections allowed 114 | 115 | -- if user pressed cancel 116 | if layerNamesToDelete is false then return 117 | 118 | -- delete chosen layers from all selected variants 119 | repeat with theVariant in theVariants 120 | repeat with theLayerName in layerNamesToDelete 121 | delete (every layer of theVariant where name is theLayerName) 122 | end repeat 123 | end repeat 124 | end tell 125 | 126 | if layerNamesToDelete is not false then 127 | set alertMessage to ((count of layerNamesToDelete) as text) & " layer(s) deleted." 128 | else 129 | set alertMessage to "No layers deleted." 130 | end if 131 | 132 | -- application code goes above here 133 | 134 | set alertTitle to appName & " Finished" 135 | 136 | set alertResult to (display alert alertTitle message alertMessage buttons {"OK"} giving up after 10) 137 | 138 | end run 139 | 140 | ## 141 | ## use this to handle scripts that accept drag-n-drop 142 | ## 143 | 144 | on open droppedItems 145 | end open 146 | 147 | ## 148 | ## download and install the latest CO script library 149 | ## 150 | 151 | on loadLibrary(appName as string) 152 | 153 | set myLibrary to libraryFolder & "COscriptlibrary.scpt" 154 | 155 | tell application "Finder" 156 | set libraryDownload to "curl -s -f https://raw.githubusercontent.com/walterrowe/capture-one-scripts/master/library/COscriptlibrary.applescript -o COscriptlibrary.applescript --output-dir " & libraryFolder 157 | set libraryCompile to "osacompile -x -o " & (quoted form of myLibrary) & " " & libraryFolder & "COscriptlibrary.applescript" 158 | try 159 | do shell script libraryDownload 160 | do shell script libraryCompile 161 | on error errorText 162 | -- failed to download and compile the latest library 163 | -- if we have a copy of the library installed then use it 164 | try 165 | exists (POSIX file myLibrary as alias) 166 | on error 167 | set myLibrary to POSIX path of myLibrary 168 | set alertResult to (display alert appName message "Unable to download and compile script library " & myLibrary & return & return & libraryDownload & return & return & libraryCompile & return & return & errorText buttons {"Quit"} giving up after 30) 169 | return missing value 170 | end try 171 | end try 172 | end tell 173 | 174 | try 175 | set myLibrary to load script myLibrary 176 | return myLibrary 177 | on error 178 | set myLibrary to POSIX path of myLibrary 179 | set alertResult to (display alert appName message "Unable to load script library " & myLibrary buttons {"Quit"} giving up after 30) 180 | return missing value 181 | end try 182 | 183 | end loadLibrary 184 | -------------------------------------------------------------------------------- /delete-selected-layers/README.md: -------------------------------------------------------------------------------- 1 | # App Name 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | This utility lets you delete selected layers from multiple variants. It creates a list of layer names from the selected variants, presents the list, and you choose one or more layers to delete. It doesn't matter if some variants don't have a selected layer. This is the code from the script. It is pretty straight forward. 8 | 9 | - Collect layer names from selected variants 10 | - Sort the list of layer names alphabetically 11 | - Select the names of the layers to delete 12 | - Delete the chosen layers from selected variants 13 | 14 | 15 | ```applescript 16 | tell application "Capture One" 17 | set layerNames to {} 18 | set theVariants to selected variants 19 | 20 | -- collect names of layers from all selected variants 21 | repeat with theVariant in theVariants 22 | repeat with theLayer in every layer of theVariant 23 | if layerNames does not contain name of theLayer then 24 | set end of layerNames to name of theLayer 25 | end if 26 | end repeat 27 | end repeat 28 | 29 | -- sort layer names 30 | set layerNames to myLibrary's sortList(layerNames) 31 | 32 | -- choose names of layers to delete 33 | set layerNamesToDelete to choose from list layerNames with prompt "Choose One Or More Layer To Delete" with multiple selections allowed 34 | 35 | -- delete chosen layers from all selected variants 36 | if layerNamesToDelete is not false then 37 | repeat with theVariant in theVariants 38 | repeat with theLayerName in layerNamesToDelete 39 | delete (every layer of theVariant where name is theLayerName) 40 | end repeat 41 | end repeat 42 | end if 43 | end tell 44 | ``` 45 | 46 | ## Prerequisites 47 | 48 | None 49 | 50 | ## Installation 51 | 52 | The script self-installs in your Capture One Scripts folder. 53 | 54 | 1. Open the AppleScript file in macOS Script Editor. 55 | 1. Click the "Run this script" (▶) button. 56 | 1. Open Capture One and choose Scripts > Update Script Menu. 57 | 1. You now can run the script from the Capture One Scripts menu. 58 | 59 | ## How To Use 60 | 61 | Select variants in Capture One, then run the "Delete Selected Layers" from the Capture One Scripts menu. 62 | 63 | ## Compatibility 64 | 65 | The utility has been tested on: 66 | 67 | - macOS Sonoma (Intel and M3 MacBook Pro) 68 | - Capture One 16.5 69 | 70 | ## ChangeLog 71 | 72 | - 25 Oct 2024 - initial version 73 | -------------------------------------------------------------------------------- /dt-on-set-scripts/Capture One Scripts/add_capture_to_favs.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | Add the current Capture Directory to favorites 3 | 4 | Created by Emory Dunn 5 | 6 | *) 7 | tell front document of application "Capture One 12" 8 | set captureCollection to make collection with properties {kind:favorite, file:captures} 9 | end tell -------------------------------------------------------------------------------- /dt-on-set-scripts/Capture One Scripts/apply_keywords.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | Apply keywords from the clipboard to all variants in the current collection. 3 | 4 | Each line of text in the clipboard is applied as a separate keyword. The keywords 5 | are added to the whatever the current keywords are. 6 | 7 | If you need to remove all keywords, use "Reset Keywords", which will remove all 8 | keywords from every variant in the current collection. 9 | 10 | Created by Emory Dunn 11 | 12 | *) 13 | 14 | use AppleScript version "2.4" -- Yosemite (10.10) or later 15 | use scripting additions 16 | 17 | set theRawKeywords to the clipboard as string 18 | 19 | set dialogAnswer to display dialog ¬ 20 | "Apply " & number of paragraphs of theRawKeywords & " keywords" buttons {"Reset Keywords", "No", "Yes"} ¬ 21 | default button "Yes" 22 | if button returned of dialogAnswer is "Yes" then 23 | repeat with theLine in paragraphs of theRawKeywords 24 | log theLine as string 25 | setKeyword(theLine) 26 | end repeat 27 | else if button returned of dialogAnswer is "Reset Keywords" then 28 | resetKeywords() 29 | end if 30 | 31 | 32 | on setKeyword(theKeyword) 33 | tell front document of application "Capture One 12" 34 | -- Capture One does not allow `,` or `|` in keywords 35 | set theCleanKeyword to my replace_chars(theKeyword, ",", " ") 36 | set theCleanKeyword to my replace_chars(theCleanKeyword, "|", " ") 37 | 38 | repeat with theVariant in variants of current collection 39 | tell theVariant to make keyword with properties {name:theCleanKeyword} 40 | 41 | end repeat 42 | 43 | end tell 44 | end setKeyword 45 | 46 | on resetKeywords() 47 | tell front document of application "Capture One 12" 48 | 49 | delete every keyword of every variant of current collection 50 | 51 | end tell 52 | 53 | end resetKeywords 54 | 55 | -- From https://www.macosxautomation.com/applescript/sbrt/sbrt-06.html 56 | on replace_chars(this_text, search_string, replacement_string) 57 | set AppleScript's text item delimiters to the search_string 58 | set the item_list to every text item of this_text 59 | set AppleScript's text item delimiters to the replacement_string 60 | set this_text to the item_list as string 61 | set AppleScript's text item delimiters to "" 62 | return this_text 63 | end replace_chars -------------------------------------------------------------------------------- /dt-on-set-scripts/Capture One Scripts/batch_rename_collection.applescript: -------------------------------------------------------------------------------- 1 | use AppleScript version "2.4" -- Yosemite (10.10) or later 2 | use scripting additions 3 | 4 | tell front document of application "Capture One 12" 5 | -- Sort by date 6 | set sorting order of current collection to by date 7 | set sorting reversed of current collection to false 8 | 9 | -- Get current collections variants 10 | set theVariants to every variant of current collection 11 | log "Renaming " & number of theVariants & " variants" 12 | 13 | -- Batch rename 14 | set counter of batch rename settings to 1 15 | batch rename variants theVariants 16 | end tell 17 | -------------------------------------------------------------------------------- /dt-on-set-scripts/Capture One Scripts/make_new_dir.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | Creates new directories inside of the Capture directory and sets the capture directory. 3 | 4 | When running the script you'll be prompted for a new directory name. The prompt 5 | will repeat allowing going back to FileMaker or a spreadsheet, enter an empty string 6 | to end the loop. 7 | 8 | New directories are created adjacent to the current capture directory, _unless_ 9 | the capture directory is "Capture", in which case new folders are made inside. 10 | 11 | Set `repeatPrompt` to `false` to only prompt for one name. 12 | 13 | If `setCaptureFolder` is `true` then the capture directory will be 14 | set to the *first* directory name entered. 15 | 16 | Created by Emory Dunn 17 | 18 | *) 19 | 20 | -- Settings 21 | set repeatPrompt to true 22 | set setCaptureFolder to true 23 | 24 | -- Script Below 25 | -- Do Not Modify 26 | 27 | set newDirs to getDirs(not repeatPrompt) 28 | set fullPaths to makeDirs(newDirs) 29 | addFavorites(fullPaths, setCaptureFolder) 30 | 31 | on getDirs(askOnce) 32 | -- present a modal asking for a name 33 | set newDirs to [] 34 | set previousAnswer to "nil" 35 | 36 | try 37 | repeat while previousAnswer is not "" 38 | set theResponse to display dialog ¬ 39 | "New Folder Name" default answer ¬ 40 | "" buttons {"Cancel", "Next"} ¬ 41 | default button ¬ 42 | "Next" cancel button "Cancel" 43 | 44 | set responseText to text returned of theResponse 45 | 46 | if responseText is not "" then 47 | set newDirs to newDirs & responseText 48 | end if 49 | if askOnce then 50 | set previousAnswer to "" 51 | else 52 | set previousAnswer to responseText 53 | end if 54 | 55 | end repeat 56 | end try 57 | return newDirs 58 | 59 | end getDirs 60 | 61 | on makeDirs(dirNames) 62 | tell front document of application "Capture One 12" 63 | set currentCaptureDir to captures 64 | tell application "Finder" to set captureName to name of folder currentCaptureDir 65 | 66 | set newDirs to [] 67 | 68 | -- if the name is not Capture, we need to create our folder under the main Capture dir 69 | if captureName is not "Capture" then 70 | tell application "Finder" 71 | set d to currentCaptureDir as alias 72 | set currentCaptureDir to container of d as alias 73 | end tell 74 | 75 | end if 76 | 77 | repeat with newName in dirNames 78 | set newDir to POSIX path of currentCaptureDir & newName 79 | set newDirs to newDirs & newDir 80 | 81 | tell application "Finder" 82 | try 83 | log "Making new dir " & newDir 84 | make new folder at currentCaptureDir with properties {name:newName} 85 | end try 86 | 87 | end tell 88 | log newDir 89 | end repeat 90 | 91 | end tell 92 | return newDirs 93 | end makeDirs 94 | 95 | on addFavorites(dirPaths, setCapture) 96 | tell front document of application "Capture One 12" 97 | 98 | set capture counter to 1 99 | 100 | -- Add all paths to favorites 101 | repeat with dirPath in dirPaths 102 | set captureCollection to make collection with properties {kind:favorite, file:dirPath} 103 | end repeat 104 | 105 | if setCapture is true and (count of dirPaths) is greater than 0 then 106 | -- Set the first item as the capture folder 107 | set captures to first item in dirPaths 108 | end if 109 | end tell 110 | 111 | end addFavorites 112 | -------------------------------------------------------------------------------- /dt-on-set-scripts/Capture One Scripts/select_next_capture.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | Moves the capture directory down the list of favorites 3 | relative to the current capture directory. 4 | 5 | Created by Emory Dunn 6 | *) 7 | 8 | tell front document of application "Capture One 12" 9 | 10 | set theFolder to captures 11 | set captureCollection to item 1 of (collections whose folder is theFolder and user is true) 12 | --log name of captureCollection as string 13 | --log captureCollection 14 | 15 | try 16 | set newCapture to the collection after captureCollection 17 | --log name of newCapture as string 18 | --log newCapture 19 | 20 | if file of newCapture is equal to missing value then 21 | log "No file for " & name of newCapture as string 22 | else 23 | log "Setting capture dir to " & name of newCapture 24 | set captures to get the file of newCapture 25 | end if 26 | 27 | on error errMsg number errNum 28 | log "End of the list" 29 | end try 30 | 31 | end tell 32 | -------------------------------------------------------------------------------- /dt-on-set-scripts/Capture One Scripts/select_previous_capture.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | Moves the capture directory down the list of favorites 3 | relative to the current capture directory. 4 | 5 | Created by Emory Dunn 6 | *) 7 | 8 | tell front document of application "Capture One 12" 9 | 10 | set theFolder to captures 11 | set captureCollection to item 1 of (collections whose folder is theFolder and user is true) 12 | --log name of captureCollection as string 13 | --log captureCollection 14 | 15 | try 16 | set newCapture to the collection before captureCollection 17 | --log name of newCapture as string 18 | --log newCapture 19 | 20 | if file of newCapture is equal to missing value then 21 | log "No file for " & name of newCapture as string 22 | else 23 | log "Setting capture dir to " & name of newCapture 24 | set captures to get the file of newCapture 25 | end if 26 | 27 | on error errMsg number errNum 28 | log "End of the list" 29 | end try 30 | 31 | end tell 32 | -------------------------------------------------------------------------------- /dt-on-set-scripts/Capture One Scripts/smart_album_for_selection.applescript: -------------------------------------------------------------------------------- 1 | -- 2 | -- Created by: Emory Dunn 3 | -- Created on: 2018-03-13 4 | -- 5 | -- Copyright © 2018 Emory Dunn, All Rights Reserved 6 | -- 7 | 8 | use AppleScript version "2.4" -- Yosemite (10.10) or later 9 | use scripting additions 10 | 11 | on run 12 | 13 | -- Parameters 14 | set theDelimiter to "_" 15 | set itemNumber to 3 16 | 17 | -- Script below 18 | 19 | tell front document of application "Capture One 12" to set selectedItem to current collection 20 | 21 | set theName to my theSplit(name of selectedItem, theDelimiter) 22 | set theNameComponent to item itemNumber of theName 23 | 24 | set theRules to "displayName6" & theNameComponent & "" 25 | 26 | tell front document of application "Capture One 12" 27 | make new collection with properties {name:theNameComponent, kind:smart album, rules:theRules} 28 | end tell 29 | end run 30 | 31 | on theSplit(theString, theDelimiter) 32 | -- save delimiters to restore old settings 33 | set oldDelimiters to AppleScript's text item delimiters 34 | -- set delimiters to delimiter to be used 35 | set AppleScript's text item delimiters to theDelimiter 36 | -- create the array 37 | set theArray to every text item of theString 38 | -- restore the old setting 39 | set AppleScript's text item delimiters to oldDelimiters 40 | -- return the result 41 | return theArray 42 | end theSplit -------------------------------------------------------------------------------- /dt-on-set-scripts/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Emory Dunn 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /dt-on-set-scripts/README.md: -------------------------------------------------------------------------------- 1 | # CaptureOneScripts 2 | A collection of AppleScripts for use with Capture One. 3 | 4 | | Script | Compatability | Shortcut | 5 | |---------------------------|--------------:|----------------:| 6 | | add_capture_to_favs | 9+ | ⌃f 7 | | apply_keywords | 10+ | ⇧⌘K 8 | | batch_rename_collection | 12 | 9 | | make_new_dir | 9+ | ⌃n 10 | | select_next_capture | 12 | ⌃↑ 11 | | select_previous_capture | 12 | ⌃↓ 12 | | smart_album_for_selection | 9+ | 13 | 14 | 15 | ## Installation 16 | 17 | Run `install.command`, which will copy the scripts to `~/Library/Scripts/Capture One Scripts` and set up the keyboard shortcuts. 18 | 19 | Some notes: 20 | 21 | - The script defaults to adding shortcuts for Capture One 20. 22 | - Capture One should be restarted after installation 23 | - MacOS might not show the shortcuts in System Preferences. 24 | 25 | 26 | ## The Scripts 27 | 28 | ### Add Capture to Favs 29 | 30 | Adds the current Capture Directory to favorites 31 | 32 | ### Apply Keywords 33 | 34 | Apply keywords from the clipboard to all variants in the current collection. 35 | 36 | Each line of text in the clipboard is applied as a separate keyword. The keywords are added to the whatever the current keywords are. 37 | 38 | If you need to remove all keywords, use "Reset Keywords", which will remove all 39 | keywords from every variant in the current collection. 40 | 41 | ### Make New Dir 42 | 43 | Creates new directories inside of the Capture directory and sets the capture directory. 44 | 45 | When running the script you'll be prompted for a new directory name. The prompt 46 | will repeat allowing going back to FileMaker or a spreadsheet, enter an empty string to end the loop. 47 | 48 | New directories are created adjacent to the current capture directory, _unless_ 49 | the capture directory is "Capture", in which case new folders are made inside. 50 | 51 | Set `repeatPrompt` to `false` to only prompt for one name. 52 | 53 | If `setCaptureFolder` is `true` then the capture directory will be 54 | set to the *first* directory name entered. 55 | 56 | ### Select Next/ Previous Capture 57 | 58 | Moves the capture directory up or down the list of favorites relative to the current capture directory. 59 | 60 | _Note_: The new versions of these scripts will only work in Capture One 12 and later. 61 | 62 | [favorite_order]: https://emorydunn.com/2018/02/27/Capture-One-Collections-and-AppleScript 63 | 64 | ### Smart Album For Selection 65 | 66 | Creates a smart album from the name of the selected album. 67 | 68 | There are two parameters for configuring the search terms: 69 | 70 | - `theDelimiter`, default `_` 71 | - `itemNumber`, default `3` 72 | 73 | The script splits the name on the delimiter and selects the `itemNumber` item in the new list for the search term. For instance, `some_file_name` would have a smart album called `name` made for it. 74 | 75 | ### Batch Rename Collection 76 | 77 | Sorts the current collection by date (ascending), sets the rename counter to 1, and renames all variants. 78 | -------------------------------------------------------------------------------- /dt-on-set-scripts/install.command: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | SCRIPT_DIR=`dirname "${0}"` 4 | INSTALL_DIR="${HOME}/Library/Scripts/Capture One Scripts" 5 | CAPTUREONE="com.captureone.captureone13" 6 | 7 | ADD_SHORTCUT="defaults write ${CAPTUREONE} NSUserKeyEquivalents -dict-add" 8 | 9 | 10 | echo "Copying scripts..." 11 | for d in "${SCRIPT_DIR}/Capture One Scripts"/*.applescript ; do \ 12 | echo " ${d}" 13 | cp "${d}" "${INSTALL_DIR}" 14 | done 15 | 16 | echo "Setting keyboard shortcuts..." 17 | ${ADD_SHORTCUT} "Scriptsapply_keywords" "@\$k" 18 | 19 | ${ADD_SHORTCUT} "Scriptsmake_new_dir" "^n" 20 | 21 | ${ADD_SHORTCUT} "Scriptsselect_previous_capture" "^↑" 22 | ${ADD_SHORTCUT} "Scriptsselect_next_capture" "^↓" 23 | 24 | ${ADD_SHORTCUT} "Scriptsadd_capture_to_favs" "^f" 25 | echo "Done" -------------------------------------------------------------------------------- /find-offline-files/README.md: -------------------------------------------------------------------------------- 1 | # find-offline-files 2 | 3 | Detailed writeup coming soon. 4 | -------------------------------------------------------------------------------- /label-untitled-variants/Installer.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | AUTHOR 3 | 4 | Author: Walter Rowe 5 | Contact: walter@walterrowe.com 6 | 7 | Created: 11-Nov-2023 8 | Updated: 20-Aug-2024 9 | 10 | DESCRIPTION 11 | 12 | Set the color label to blue for every variant with an empty IPTC title 13 | 14 | Originally developed with Eric Valk (@ericnepean in Capture One Forums) 15 | 16 | PREREQUISITES 17 | 18 | None 19 | *) 20 | 21 | use AppleScript version "2.8" 22 | use scripting additions 23 | 24 | property libraryFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/" 25 | property installFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/Capture One Scripts/" 26 | 27 | property installNames : {"Label Untitled Variants"} 28 | property installType : ".scpt" -- ".scpt" for script, ".app" for script app 29 | property installIcon : false -- if true must have a droplet.icns icon file in the source folder and ".app" installType 30 | 31 | property requiresCOrunning : true -- true if capture one is required to be running 32 | property requiresCOdocument : true -- true, false, "catalog", "session" 33 | 34 | property appTesting : false -- if true, run in script editor, and if false install the script 35 | 36 | -- application specific properties below 37 | 38 | -- application specific properties above 39 | 40 | ## 41 | ## use this to handle typical running from Capture One Scripts menu 42 | ## 43 | 44 | on run 45 | 46 | -- set required base variables 47 | set appName to my name 48 | set appPath to path to me 49 | 50 | -- make sure the CO script library is loaded 51 | set myLibrary to loadLibrary(appName) 52 | if myLibrary is missing value then return 53 | 54 | -- do install if not running under app name 55 | if installNames does not contain appName and not appTesting then 56 | myLibrary's installMe(appName, appPath, installFolder, installType, installNames, installIcon) 57 | return 58 | end if 59 | 60 | -- if app testing and we have multiple install names choose what action to perform 61 | if appTesting is true then 62 | if (count of installNames) > 1 then 63 | set appName to choose from list installNames with prompt "Choose Target Layer To Sync" 64 | if appName is false then return 65 | set appName to first item of appName 66 | else 67 | set appName to item 1 of installNames 68 | end if 69 | end if 70 | 71 | -- verify Capture One is running and has a document open 72 | set readyToRun to myLibrary's meetsRequirements(appName, requiresCOrunning, requiresCOdocument) 73 | if not readyToRun then return 74 | 75 | -- get path to Capture One's app icon 76 | set coIcon to path to resource "AppIcon.icns" in bundle (path to application "Capture One") 77 | 78 | -- ensure we have permission to interact with other apps 79 | myLibrary's activateUIScripting() 80 | 81 | -- application code goes below here 82 | 83 | tell application "Capture One" 84 | set variantCount to count of (every variant whose content headline is "") 85 | tell (every variant whose content headline is "") to set color tag to 5 86 | end tell 87 | 88 | set alertMessage to "Updated " & variantCount & " variants." 89 | 90 | -- application code goes above here 91 | 92 | set alertTitle to appName & " Finished" 93 | 94 | set alertResult to (display alert alertTitle message alertMessage buttons {"OK"} giving up after 10) 95 | 96 | end run 97 | 98 | ## 99 | ## download and install the latest CO script library 100 | ## 101 | 102 | on loadLibrary(appName as string) 103 | 104 | set myLibrary to libraryFolder & "COscriptlibrary.scpt" 105 | 106 | tell application "Finder" 107 | set libraryDownload to "curl -s -f https://raw.githubusercontent.com/walterrowe/capture-one-scripts/master/library/COscriptlibrary.applescript -o COscriptlibrary.applescript --output-dir " & libraryFolder 108 | set libraryCompile to "osacompile -x -o " & (quoted form of myLibrary) & " " & libraryFolder & "COscriptlibrary.applescript" 109 | try 110 | do shell script libraryDownload 111 | do shell script libraryCompile 112 | on error errorText 113 | -- failed to download and compile the latest library 114 | -- if we have a copy of the library installed then use it 115 | try 116 | exists (POSIX file myLibrary as alias) 117 | on error 118 | set myLibrary to POSIX path of myLibrary 119 | set alertResult to (display alert appName message "Unable to download and compile script library " & myLibrary & return & return & libraryDownload & return & return & libraryCompile & return & return & errorText buttons {"Quit"} giving up after 30) 120 | return missing value 121 | end try 122 | end try 123 | end tell 124 | 125 | try 126 | set myLibrary to load script myLibrary 127 | return myLibrary 128 | on error 129 | set myLibrary to POSIX path of myLibrary 130 | set alertResult to (display alert appName message "Unable to load script library " & myLibrary buttons {"Quit"} giving up after 30) 131 | return missing value 132 | end try 133 | 134 | end loadLibrary 135 | -------------------------------------------------------------------------------- /label-untitled-variants/README.md: -------------------------------------------------------------------------------- 1 | # Label Untitled Variants 2 | 3 | Author: Eric Nepean (@EricNepean) 4 | 5 | This script sets the color label to blue (5) for every variant with an empty iptc title. 6 | 7 | ```applescript 8 | tell application "Capture One" to tell (every variant whose content headline is "") to set color tag to 5 9 | ``` 10 | 11 | # Installation 12 | 13 | The script self-installs in your Capture One Scripts folder. 14 | 15 | 1. Open the AppleScript file in macOS Script Editor. 16 | 1. Click the "Run this script" (▶) button. 17 | 1. Open Capture One and choose Scripts > Update Script Menu. 18 | 1. You now can run the script from the Capture One Scripts menu. 19 | 20 | ## UPDATEs 21 | 22 | - 13 Aug 2024 - enhanced installer and requirements checks 23 | -------------------------------------------------------------------------------- /library/COscriptlibrary.applescript: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/walterrowe/capture-one-scripts/ee494a8fc2cd3c29a30aa098c2149bda38788f70/library/COscriptlibrary.applescript -------------------------------------------------------------------------------- /location-from-gps/Installer.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | AUTHOR 3 | 4 | Author: Walter Rowe 5 | Contact: walter@walterrowe.com 6 | 7 | Created: 06-APR-2023 8 | Updated: 20-AUG-2024 9 | 10 | DESCRIPTION 11 | 12 | This script looks for EXIF GPS latitude and longitude coordinates 13 | If present it uses Google Maps API to get real place location info 14 | 15 | * Populates the IPTC fields for City, State, Country, Country Code 16 | * Adds Hierarhical Keyword for Country > State/Province > County > City 17 | 18 | PREREQUISITES 19 | 20 | * JSON Helper installed 21 | * Google Maps API Key 22 | *) 23 | 24 | property version : "3.0" 25 | 26 | use AppleScript version "2.8" 27 | use scripting additions 28 | 29 | property installFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/Capture One Scripts/" 30 | property libraryFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/" 31 | 32 | property installNames : {"Location From GPS"} 33 | property installType : ".scpt" 34 | property installIcon : false -- if true must have a droplet.icns icon file in the source folder and ".app" installType 35 | 36 | property requiresCOrunning : true -- true if capture one is required to be running 37 | property requiresCOdocument : true -- true, false, "catalog", "session" 38 | 39 | property appTesting : false -- if true, run in script editor, and if false install the script 40 | 41 | -- application specific properties below 42 | 43 | property mapsPropertyFile : ((POSIX path of (path to home folder)) as string) & "Library/Preferences/location_from_gps.plist" 44 | 45 | property mapsKeyProperty : "Google Maps API Key" as text 46 | property mapsURL : "" 47 | 48 | -- application specific properties above 49 | 50 | on run 51 | 52 | -- set required base variables 53 | set appName to my name 54 | set appPath to path to me 55 | 56 | -- make sure the CO script library is loaded 57 | set myLibrary to loadLibrary(appName) 58 | if myLibrary is missing value then return 59 | 60 | -- do install if not running under app name 61 | if installNames does not contain appName and not appTesting then 62 | myLibrary's installMe(appName, appPath, installFolder, installType, installNames, installIcon) 63 | return 64 | end if 65 | 66 | -- if app testing and we have multiple install names choose what action to perform 67 | if appTesting is true then 68 | if (count of installNames) > 1 then 69 | set appName to choose from list installNames with prompt "Choose Target Layer To Sync" 70 | if appName is false then return 71 | set appName to first item of appName 72 | else 73 | set appName to item 1 of installNames 74 | end if 75 | end if 76 | 77 | -- verify Capture One is running and has a document open 78 | set readyToRun to myLibrary's meetsRequirements(appName, requiresCOrunning, requiresCOdocument) 79 | if not readyToRun then return 80 | 81 | -- get path to Capture One's app icon 82 | set coIcon to path to resource "AppIcon.icns" in bundle (path to application "Capture One") 83 | 84 | -- ensure we have permission to interact with other apps 85 | myLibrary's activateUIScripting() 86 | 87 | -- APPLICATION CODE GOES BELOW HERE 88 | 89 | -- check for property list file and read Google Maps API Key 90 | set mapsAPIkey to myLibrary's readProperty(mapsPropertyFile, mapsKeyProperty) 91 | 92 | -- if plist file or maps API key are not found, get it from user and store it 93 | if mapsAPIkey is missing value then 94 | display alert appName message "We were unable to find the Google Maps API Key in the property list file. You will be prompted to enter your key so it can be stored for you. The property list file is called:" & return & return & mapsPropertyFile & return & return & "In the future the key will be read from the property list file automatically." buttons {"Continue"} 95 | try 96 | set mapsAPIkey to text returned of (display dialog "Enter Google Maps API Key:" default answer "" with icon coIcon buttons {"Cancel", "Continue"} default button "Continue") 97 | on error 98 | return 99 | end try 100 | myLibrary's storeProperty(mapsPropertyFile, mapsKeyProperty, mapsAPIkey) 101 | end if 102 | 103 | -- set the Google Maps API URL prefix with our maps API key 104 | set mapsURL to "https://maps.googleapis.com/maps/api/geocode/json?key=" & mapsAPIkey & "&latlng=" 105 | 106 | -- process images 107 | tell application "Capture One" 108 | set startTime to current date 109 | set imageSel to get selected variants 110 | set noGPS to {} 111 | 112 | tell me to myLibrary's progress_start(0, "Processing ...", "scanning") 113 | set imgCount to count of imageSel 114 | 115 | repeat with i from 1 to imgCount 116 | tell me to myLibrary's progress_update(i, imgCount, "") 117 | set thisVariant to item i of imageSel 118 | 119 | if (latitude of thisVariant is missing value) or (longitude of thisVariant is missing value) then 120 | set end of noGPS to name of parent image of thisVariant 121 | else 122 | 123 | set lat to my myLibrary's replace(((latitude of thisVariant as real) as string), "/,/", ".") 124 | set lon to my myLibrary's replace(((longitude of thisVariant as real) as string), "/,/", ".") 125 | set gpsFetch to (mapsURL & lat & "," & lon) as string 126 | 127 | -- if testing display the URL with longitude and latitude to debug 128 | -- if appTesting then display dialog gpsFetch buttons {"OK"} 129 | 130 | tell application "JSON Helper" 131 | try 132 | set gpsResult to (fetch JSON from gpsFetch) 133 | on error 134 | tell me to set alertResult to (display alert appBase message "Unable to get Google Maps information." buttons {"Exit"}) 135 | return 136 | end try 137 | 138 | if gpsResult is "" or results of gpsResult is {} then 139 | tell me to set alertResult to (display alert appBase message "Unable to get Google Maps information." buttons {"Exit"}) 140 | return 141 | else 142 | 143 | set address_components to get address_components of item 1 of results of gpsResult 144 | 145 | -- making a list (Array) of address component names 146 | set imgCity to "" 147 | set imgCounty to "" 148 | set imgState to "" 149 | set imgCountry to "" 150 | set gotGPS to false 151 | repeat with j from 1 to count of address_components 152 | -- get location components 153 | set addressInfo to get item j of address_components 154 | if item 1 of |types| of addressInfo is in {"locality", "administrative_area_level_2", "administrative_area_level_1", "country"} then 155 | 156 | set gotGPS to true 157 | 158 | if item 1 of |types| of addressInfo is "locality" then 159 | tell application "Capture One" to set image city of thisVariant to long_name of addressInfo 160 | set imgCity to long_name of addressInfo 161 | end if 162 | 163 | if item 1 of |types| of addressInfo is "administrative_area_level_2" then 164 | set imgCounty to long_name of addressInfo 165 | end if 166 | 167 | if item 1 of |types| of addressInfo is "administrative_area_level_1" then 168 | tell application "Capture One" to set image state of thisVariant to long_name of addressInfo 169 | set imgState to long_name of addressInfo 170 | end if 171 | 172 | if item 1 of |types| of addressInfo is "country" then 173 | tell application "Capture One" to set image country of thisVariant to long_name of addressInfo 174 | tell application "Capture One" to set image country code of thisVariant to short_name of addressInfo 175 | set imgCountry to long_name of addressInfo 176 | end if 177 | end if 178 | end repeat 179 | end if 180 | end tell 181 | 182 | if gotGPS is true then 183 | tell thisVariant to make keyword with properties {name:imgCity, parent:imgCountry & "|" & imgState & "|" & imgCounty} 184 | end if 185 | 186 | end if 187 | tell me to myLibrary's progress_step(i) 188 | 189 | end repeat 190 | 191 | end tell 192 | 193 | myLibrary's progress_end() 194 | 195 | set timeTaken to ((current date) - startTime) 196 | set timeTaken to ((timeTaken / 60 as integer) as string) & ":" & (text -1 thru -2 of ("0" & (timeTaken mod 60 as integer) as string)) 197 | 198 | set noGPScount to (count of noGPS) 199 | set imgsUpdated to imgCount - noGPScount 200 | 201 | set alertMessage to "Processed " & (imgCount as text) & " images." & return & return & "Updated: " & imgsUpdated & return & "Skipped: " & (noGPScount as text) & return & return & "Time Elapsed: " & timeTaken & " (mm:ss)." 202 | 203 | -- APPLICATION CODE GOES ABOVE HERE 204 | 205 | set alertResult to (display alert appName message alertMessage buttons {"OK"} giving up after 10) 206 | 207 | end run 208 | 209 | 210 | ## 211 | ## download and install the latest CO script library 212 | ## 213 | 214 | on loadLibrary(appName as string) 215 | 216 | set myLibrary to libraryFolder & "COscriptlibrary.scpt" 217 | 218 | tell application "Finder" 219 | set libraryDownload to "curl -s -f https://raw.githubusercontent.com/walterrowe/capture-one-scripts/master/library/COscriptlibrary.applescript -o COscriptlibrary.applescript --output-dir " & libraryFolder 220 | set libraryCompile to "osacompile -x -o " & (quoted form of myLibrary) & " " & libraryFolder & "COscriptlibrary.applescript" 221 | try 222 | do shell script libraryDownload 223 | do shell script libraryCompile 224 | on error errorText 225 | -- failed to download and compile the latest library 226 | -- if we have a copy of the library installed then use it 227 | try 228 | exists (POSIX file myLibrary as alias) 229 | on error 230 | set myLibrary to POSIX path of myLibrary 231 | set alertResult to (display alert appName message "Unable to download and compile script library " & myLibrary & return & return & libraryDownload & return & return & libraryCompile & return & return & errorText buttons {"Quit"} giving up after 30) 232 | return missing value 233 | end try 234 | end try 235 | end tell 236 | 237 | try 238 | set myLibrary to load script myLibrary 239 | return myLibrary 240 | on error 241 | set myLibrary to POSIX path of myLibrary 242 | set alertResult to (display alert appName message "Unable to load script library " & myLibrary buttons {"Quit"} giving up after 30) 243 | return missing value 244 | end try 245 | 246 | end loadLibrary 247 | -------------------------------------------------------------------------------- /location-from-gps/README.md: -------------------------------------------------------------------------------- 1 | # Location from GPS 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | For the selected variants scan for GPS coordinates. If GPS coordinates are present then use Google Maps to get location attributes for city, county, state, country, country code. 8 | 9 | * Apply a hierarchical keyword for country > state > county > city 10 | * Set variant IPTC fields for city, state, country, country code 11 | 12 | ## Prerequisites 13 | 14 | - JSON Helper 15 | - Google Maps API Key 16 | 17 | This utility uses JSON Helper to parse the JSON returned from the Google Maps API. It requires your [Google Maps API Key (via Google Developer portal)](https://developers.google.com/maps/documentation/geocoding/get-api-key) to authenticate with the Google Maps API service to fetch address information using latitude and longitude values associated with each selected image. 18 | 19 | You will be prompted to enter your API key the first time you use this utility. It will store the key in a property list file in your home directory and read it from there with each subsequent use. This is decribed in more detail below. 20 | 21 | ## Installation 22 | 23 | The script self-installs in your Capture One Scripts folder. 24 | 25 | 1. Open the AppleScript file in macOS Script Editor. 26 | 1. Click the "Run this script" (▶) button. 27 | 1. Open Capture One and choose Scripts > Update Script Menu. 28 | 1. You now can run the script from the Capture One Scripts menu. 29 | 30 | ## How To Use 31 | 32 | Select a batch of pictures in Capture One and run the script. 33 | 34 | ## Maps API Key 35 | 36 | The first time you run the script it will ask for your Google Maps API Key. The key will be stored in a property list file. Each subsequent time the script is run it will read the key from the property list file. The property list file is called ` location_from_gps.plist ` and is stored in your home folder under the ` ~/Library/Preferences ` folder. 37 | 38 | When you copy-paste your API key into the dialog you may only see the last few characters of the key. This is because the dialog box has wrapped the text line. If you press the up arrow you will see the rest of your key. Pressing the down arrow will show the end of the key again. Do not fear. The entire key will be stored in the property list file and used to query the Google Maps location service. 39 | 40 | ## ChangeLog 41 | 42 | - 13 Aug 2024 - enhanced installer and requirements checks 43 | - 06 Sep 2024 - store maps api key in property list file 44 | -------------------------------------------------------------------------------- /managed-to-referenced/Installer.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | AUTHOR 3 | 4 | Author: Walter Rowe 5 | Contact: walter@walterrowe.com 6 | 7 | Created: 02-Aug-2024 8 | Updated: 20-Aug-2024 9 | 10 | DESCRIPTION 11 | 12 | This script moves managed catalog images to referenced EXIF date based folders (YYYY/MM/DD) 13 | 14 | PREREQUISITES 15 | 16 | None 17 | *) 18 | 19 | use AppleScript version "2.8" 20 | use scripting additions 21 | 22 | property libraryFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/" 23 | property installFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/Capture One Scripts/" 24 | 25 | property installNames : {"Move Managed to Referenced"} 26 | property installType : ".scpt" -- ".scpt" for script, ".app" for script app 27 | property installIcon : false -- if true must have a droplet.icns icon file in the source folder and ".app" installType 28 | 29 | property requiresCOrunning : true -- true if capture one is required to be running 30 | property requiresCOdocument : "catalog" -- true, false, "catalog", "session" 31 | 32 | property appTesting : false -- if true, run in script editor, and if false install the script 33 | 34 | -- application specific properties below 35 | 36 | -- application specific properties above 37 | 38 | on run 39 | -- set required base variables 40 | set appName to my name 41 | set appPath to path to me 42 | 43 | -- make sure the CO script library is loaded 44 | set myLibrary to loadLibrary(appName) 45 | if myLibrary is missing value then return 46 | 47 | -- do install if not running under app name 48 | if installNames does not contain appName and not appTesting then 49 | myLibrary's installMe(appName, appPath, installFolder, installType, installNames, installIcon) 50 | return 51 | end if 52 | 53 | -- if app testing and we have multiple install names choose what action to perform 54 | if appTesting is true then 55 | if (count of installNames) > 1 then 56 | set appName to choose from list installNames with prompt "Choose Target Layer To Sync" 57 | if appName is false then return 58 | set appName to first item of appName 59 | else 60 | set appName to item 1 of installNames 61 | end if 62 | end if 63 | 64 | -- verify Capture One is running and has a document open 65 | set readyToRun to myLibrary's meetsRequirements(appName, requiresCOrunning, requiresCOdocument) 66 | if not readyToRun then return 67 | 68 | -- get path to Capture One's app icon 69 | set coIcon to path to resource "AppIcon.icns" in bundle (path to application "Capture One") 70 | 71 | -- ensure we have permission to interact with other apps 72 | myLibrary's activateUIScripting() 73 | 74 | -- application code goes below here 75 | 76 | -- inform user of what we plan to do and offer to cancel or continue 77 | try 78 | set alertResult to (display alert "What To Expect" message "This utility relocates images stored inside a Capture One catalog to a referenced folder of your choice outside the catalog. Any selected files that are already referenced will be skipped." & return & return & "You will choose the parent referenced folder. The script will create dated (YYYY/MM/DD) subfolders based on the EXIF image date of the selected images." & return & return & "Do you wish to Cancel or Continue?" as informational buttons {"Cancel", "Continue"} cancel button "Cancel" giving up after 10) 79 | if (gave up of alertResult) or (button returned of alertResult is "Cancel") then return 80 | on error 81 | -- graceful exit when user presses Cancel 82 | return 83 | end try 84 | 85 | tell application "Capture One" 86 | 87 | tell current document to set docPath to its path 88 | 89 | -- get all selected variants user wants to move 90 | set variantsToMove to get selected variants 91 | if (count of variantsToMove) < 1 then 92 | set alertResult to (display alert "No Selection" message "No images are selected to move." buttons {"Stop"} default button "Stop" as critical giving up after 10) 93 | return 94 | end if 95 | 96 | -- ask user to choose the parent folder for new folder tree 97 | tell application "Finder" 98 | activate 99 | set targetFolderParent to POSIX path of (choose folder with prompt "Choose PARENT Folder for Moved Images:") 100 | end tell 101 | activate 102 | 103 | -- create a list of image IDs we have already moved 104 | -- multiple variants will have the same image ID 105 | 106 | tell me to myLibrary's progress_start(0, "Moving ...", ((count of variantsToMove) as string)) 107 | 108 | set imagesMoved to {} 109 | set movedTotal to count of variantsToMove 110 | set movedCount to 0 111 | set skippedCount to 0 112 | 113 | repeat with thisVariant in variantsToMove 114 | set movedCount to movedCount + 1 115 | tell me to myLibrary's progress_update(movedCount, movedTotal, "") 116 | 117 | -- get image for this variant 118 | set thisImage to get parent image of thisVariant 119 | 120 | -- if we have not already moved this image file 121 | if imagesMoved does not contain id of thisImage then 122 | 123 | -- remember we moved this image ID 124 | set end of imagesMoved to id of thisImage 125 | 126 | -- extract date strings from image date 127 | set thisDate to EXIF capture date of thisImage 128 | 129 | set thisYear to year of thisDate as string 130 | 131 | set thisMonth to (month of thisDate as number) as string 132 | if length of thisMonth < 2 then set thisMonth to "0" & thisMonth 133 | 134 | set thisDay to day of thisDate as string 135 | if length of thisDay < 2 then set thisDay to "0" & thisDay 136 | 137 | -- construct source folder and file paths 138 | set managedPath to POSIX file (path of thisImage) as alias 139 | set managedPathStr to managedPath as string 140 | set managedName to name of thisImage 141 | 142 | -- don't move images that are already referenced 143 | if managedPathStr does not start with docPath then 144 | set skippedCount to skippedCount + 1 145 | -- display dialog "Skipping referenced image " & managedName buttons {"Skip"} with icon coIcon with title "-- ALERT --" 146 | else 147 | 148 | -- construct target folder and file paths 149 | set targetFolder to targetFolderParent & thisYear & "/" & thisMonth & "/" & thisDay & "/" 150 | set targetFile to targetFolder & managedName 151 | 152 | -- tell Finder to move the file 153 | tell application "Finder" 154 | 155 | -- create target folder if it doesn't exist 156 | if not (exists targetFolder) then 157 | do shell script "mkdir -p " & (quoted form of targetFolder) 158 | end if 159 | 160 | -- move image to target folder (requires string for file name and aliases for folders) 161 | set managedParent to container of managedPath 162 | set destFolder to ((targetFolder as POSIX file) as alias) 163 | move file managedName of managedParent to folder destFolder 164 | 165 | end tell -- Finder 166 | 167 | -- tell Capture One to relink ("locate") the image at new location 168 | relink thisImage to path targetFile 169 | end if 170 | end if 171 | tell me to myLibrary's progress_step(movedCount) 172 | 173 | end repeat -- with selected variants 174 | 175 | end tell -- Capture One 176 | 177 | tell me to myLibrary's progress_end() 178 | 179 | set alertMessage to "Moved " & ((count of imagesMoved) - skippedCount) & " files." & return & return & "Skipped " & skippedCount & " referenced images." 180 | 181 | -- application code goes above here 182 | 183 | set alertTitle to appName & " Finished" 184 | 185 | set alertResult to (display alert alertTitle message alertMessage buttons {"OK"} giving up after 10) 186 | 187 | end run 188 | 189 | ## 190 | ## download and install the latest CO script library 191 | ## 192 | 193 | on loadLibrary(appName as string) 194 | 195 | set myLibrary to libraryFolder & "COscriptlibrary.scpt" 196 | 197 | tell application "Finder" 198 | set libraryDownload to "curl -s -f https://raw.githubusercontent.com/walterrowe/capture-one-scripts/master/library/COscriptlibrary.applescript -o COscriptlibrary.applescript --output-dir " & libraryFolder 199 | set libraryCompile to "osacompile -x -o " & (quoted form of myLibrary) & " " & libraryFolder & "COscriptlibrary.applescript" 200 | try 201 | do shell script libraryDownload 202 | do shell script libraryCompile 203 | on error errorText 204 | -- failed to download and compile the latest library 205 | -- if we have a copy of the library installed then use it 206 | try 207 | exists (POSIX file myLibrary as alias) 208 | on error 209 | set myLibrary to POSIX path of myLibrary 210 | set alertResult to (display alert appName message "Unable to download and compile script library " & myLibrary & return & return & libraryDownload & return & return & libraryCompile & return & return & errorText buttons {"Quit"} giving up after 30) 211 | return missing value 212 | end try 213 | end try 214 | end tell 215 | 216 | try 217 | set myLibrary to load script myLibrary 218 | return myLibrary 219 | on error 220 | set myLibrary to POSIX path of myLibrary 221 | set alertResult to (display alert appName message "Unable to load script library " & myLibrary buttons {"Quit"} giving up after 30) 222 | return missing value 223 | end try 224 | 225 | end loadLibrary 226 | -------------------------------------------------------------------------------- /managed-to-referenced/README.md: -------------------------------------------------------------------------------- 1 | # Managed to Referenced 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | This AppleScript utility moves image files from inside a managed Capture One catalog to a referenced location outside the catalog. The files are moved into folders based on the image EXIF date. The utility does not use the date folders from the managed folders inside the catalog because the managed folder dates are based on import date. 8 | 9 | - Select the images to move from your Capture One catalog. 10 | - Choose the top level folder where the files will be moved. 11 | - The utility creates YYYY/MM/DD subfolders based on the EXIF date of the files moved. 12 | 13 | ## Prerequisites 14 | 15 | None 16 | 17 | ## Installation 18 | 19 | The script self-installs in your Capture One Scripts folder. 20 | 21 | 1. Open the AppleScript file in macOS Script Editor. 22 | 1. Click the "Run this script" (▶) button. 23 | 1. Open Capture One and choose Scripts > Update Script Menu. 24 | 1. You now can run the script from the Capture One Scripts menu. 25 | 26 | ## Compatibility 27 | 28 | The utility has been tested on: 29 | 30 | - macOS Sonoma (Intel and M3 MacBook Pro) 31 | - Capture One 16.4 32 | - Moving to internal and external storage 33 | 34 | ## ChangeLog 35 | 36 | - 13 Aug 2024 - enhanced installer and requirements checks 37 | - 03 Aug 2024 - initial version -------------------------------------------------------------------------------- /monochrome-keywords/Installer.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | AUTHOR 3 | 4 | Author: Walter Rowe 5 | Contact: walter@walterrowe.com 6 | 7 | Created: 03-Jul-2020 8 | Updated: 20-Aug-2024 9 | 10 | DESCRIPTION 11 | 12 | Apply or Remove a list of monochrome-oriented keywords from monochrome images. 13 | 14 | Monochrome criteria: 15 | 16 | * black and white is enabled 17 | --OR-- 18 | * saturation is -100.0 19 | 20 | When the script is completed, it will show a count of images updated in the results window. 21 | 22 | PREREQUISITES 23 | 24 | None 25 | *) 26 | 27 | use AppleScript version "2.8" 28 | use scripting additions 29 | 30 | property libraryFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/" 31 | property installFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/Capture One Scripts/" 32 | 33 | property installNames : {"Apply Monochrome Keywords", "Remove Monochrome Keywords"} 34 | property installType : ".scpt" -- ".scpt" for script, ".app" for script app 35 | property installIcon : false -- if true must have a droplet.icns icon file in the source folder and ".app" installType 36 | 37 | property requiresCOrunning : true -- true if capture one is required to be running 38 | property requiresCOdocument : true -- true, false, "catalog", "session" 39 | 40 | property appTesting : false -- if true, run in script editor, and if false install the script 41 | 42 | -- application specific properties below 43 | 44 | property bwKeywords : {"Black & White", "Monochrome"} 45 | 46 | -- application specific properties above 47 | 48 | on run 49 | 50 | -- set required base variables 51 | set appName to my name 52 | set appPath to path to me 53 | 54 | -- make sure the CO script library is loaded 55 | set myLibrary to loadLibrary(appName) 56 | if myLibrary is missing value then return 57 | 58 | -- do install if not running under app name 59 | if installNames does not contain appName and not appTesting then 60 | myLibrary's installMe(appName, appPath, installFolder, installType, installNames, installIcon) 61 | return 62 | end if 63 | 64 | -- if app testing and we have multiple install names choose what action to perform 65 | if appTesting is true then 66 | if (count of installNames) > 1 then 67 | set appName to choose from list installNames with prompt "Choose Target Layer To Sync" 68 | if appName is false then return 69 | set appName to first item of appName 70 | else 71 | set appName to item 1 of installNames 72 | end if 73 | end if 74 | 75 | -- verify Capture One is running and has a document open 76 | set readyToRun to myLibrary's meetsRequirements(appName, requiresCOrunning, requiresCOdocument) 77 | if not readyToRun then return 78 | 79 | -- get path to Capture One's app icon 80 | set coIcon to path to resource "AppIcon.icns" in bundle (path to application "Capture One") 81 | 82 | -- ensure we have permission to interact with other apps 83 | myLibrary's activateUIScripting() 84 | 85 | -- application code goes below here 86 | 87 | if appTesting then set appName to item 1 of (choose from list installNames) 88 | 89 | set updateCount to 0 90 | 91 | tell application "Capture One" 92 | 93 | if appName starts with "Apply" then 94 | -- get list of variants with black & white enabled or background saturation set to -100 95 | if (count of selected variants) > 0 then 96 | set monoVariants to (get variants where ((selected is true) and (black and white of adjustments is true) or (saturation of adjustments is -100.0))) 97 | else 98 | set monoVariants to (get variants where ((black and white of adjustments is true) or (saturation of adjustments is -100.0))) 99 | end if 100 | if (count of monoVariants) > 0 then 101 | repeat with bwKeyword in bwKeywords 102 | tell current document 103 | -- get or create this keyword 104 | if exists keyword bwKeyword then 105 | set monoKW to keyword bwKeyword 106 | else 107 | tell item 1 in monoVariants to set monoKW to make new keyword with properties {name:bwKeyword} 108 | end if 109 | -- apply the keyword to list of variants 110 | apply keyword monoKW to monoVariants 111 | end tell 112 | end repeat 113 | repeat with monoVariant in monoVariants 114 | if (status job identifier of monoVariant) is "" then tell monoVariant to set status job identifier to "-BW" 115 | end repeat 116 | set updateCount to (count of monoVariants) 117 | end if 118 | end if 119 | 120 | if appName starts with "Remove" then 121 | set updatedVariants to {} 122 | repeat with thisKeyword in bwKeywords 123 | if (count of selected variants) > 0 then 124 | set monoVariants to (get variants where ((selected is true) and (thisKeyword is in name of keywords))) 125 | else 126 | set monoVariants to (get variants where (thisKeyword is in name of keywords)) 127 | end if 128 | repeat with thisVariant in monoVariants 129 | if updatedVariants does not contain (id of thisVariant) then set end of updatedVariants to (id of thisVariant) 130 | tell thisVariant to set status job identifier to "" 131 | delete (every keyword of thisVariant whose name is thisKeyword) 132 | end repeat 133 | end repeat 134 | set updateCount to (count of updatedVariants) 135 | end if 136 | 137 | end tell 138 | 139 | set alertMessage to (updateCount as string) & " images updated." 140 | 141 | -- application code goes above here 142 | 143 | set alertTitle to appName & " Finished" 144 | 145 | set alertResult to (display alert alertTitle message alertMessage buttons {"OK"} giving up after 10) 146 | 147 | end run 148 | 149 | ## 150 | ## download and install the latest CO script library 151 | ## 152 | 153 | on loadLibrary(appName as string) 154 | 155 | set myLibrary to libraryFolder & "COscriptlibrary.scpt" 156 | 157 | tell application "Finder" 158 | set libraryDownload to "curl -s -f https://raw.githubusercontent.com/walterrowe/capture-one-scripts/master/library/COscriptlibrary.applescript -o COscriptlibrary.applescript --output-dir " & libraryFolder 159 | set libraryCompile to "osacompile -x -o " & (quoted form of myLibrary) & " " & libraryFolder & "COscriptlibrary.applescript" 160 | try 161 | do shell script libraryDownload 162 | do shell script libraryCompile 163 | on error errorText 164 | -- failed to download and compile the latest library 165 | -- if we have a copy of the library installed then use it 166 | try 167 | exists (POSIX file myLibrary as alias) 168 | on error 169 | set myLibrary to POSIX path of myLibrary 170 | set alertResult to (display alert appName message "Unable to download and compile script library " & myLibrary & return & return & libraryDownload & return & return & libraryCompile & return & return & errorText buttons {"Quit"} giving up after 30) 171 | return missing value 172 | end try 173 | end try 174 | end tell 175 | 176 | try 177 | set myLibrary to load script myLibrary 178 | return myLibrary 179 | on error 180 | set myLibrary to POSIX path of myLibrary 181 | set alertResult to (display alert appName message "Unable to load script library " & myLibrary buttons {"Quit"} giving up after 30) 182 | return missing value 183 | end try 184 | 185 | end loadLibrary 186 | -------------------------------------------------------------------------------- /monochrome-keywords/README.md: -------------------------------------------------------------------------------- 1 | # Monochrome Keywords 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | There are two scripts in this directory. 8 | 9 | * [apply-monochrome-keywords](apply-monochrome-keywords.applescript) - adds keywords to the images matching the criteria. 10 | * [remove-monochrome-keywords](remove-monochrome-keywords.applescript) - removes keywords from images not matching the criteria. 11 | 12 | These script will run on the currently selected document and collection. It should honor any filters on the view. 13 | 14 | ## Prerequisites 15 | 16 | None 17 | 18 | ## Installation 19 | 20 | The script self-installs in your Capture One Scripts folder. 21 | 22 | 1. Open the AppleScript file in macOS Script Editor. 23 | 1. Click the "Run this script" (▶) button. 24 | 1. Open Capture One and choose Scripts > Update Script Menu. 25 | 1. You now can run the script from the Capture One Scripts menu. 26 | 27 | ## How To Use 28 | 29 | ### Monochrome Image Criteria 30 | 31 | The criteria for identifying monochrome images are: 32 | 33 | 1. The black and white tool is enabled (checked), OR 34 | 2. The saturation of the background layer set to -100 35 | 36 | You may ask why the script only looks at the background layer for the saturation adjustment value of -100. The background layer contains no mask. It applies the adjustment globally to the entire image. Other layers may have masks that do not affect the entire image. We cannot assume these other layers result in a monochrome image. 37 | 38 | ### Apply Monochrome Keywords 39 | 40 | For each variant matching the above criteria, it adds each of the keywords in the list ```bwKeywords```. 41 | 42 | **NOTICE**: RGB grayscale color profile images will not be identified as monochrome. No keywords will be applied. You will have to visually identify and tag these images manually. 43 | 44 | ### Remove Monochrome Keywords 45 | 46 | For each variant NOT matching the above criteria, AND having one of the keywords in the list ```bwKeywords```, the requisite keyword is removed. 47 | 48 | **NOTICE**: RGB grayscale color profile images will not be identified as monochrome. Monochrome keywords WILL be removed because they will not match the criteria above. Filter your collection view to exclude these image to avoid this. 49 | 50 | ### Change The Keywords 51 | 52 | The default list includes ```Monochrome``` and ```Black & White```. 53 | 54 | You can change the list of keywords by finding the line 55 | 56 | ``` 57 | set bwKeywords to { "Black & White", "Monochrome" } 58 | ``` 59 | 60 | and changing the list of keywords to words of your choosing for your monochrome images. Remember that each keyword must be in double quotes, the list must be comma-separated, and there must be curly braces enclosing the list as shown here. 61 | 62 | ## Compatibility 63 | 64 | The utility has been tested on: 65 | 66 | - macOS Sonoma (Intel and M3 MacBook Pro) 67 | - Capture One 16.4 68 | - Moving to internal and external storage 69 | 70 | ## ChangeLog 71 | 72 | - 13 Aug 2024 - enhanced installer and requirements checks 73 | -------------------------------------------------------------------------------- /search-by-month/Installer.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | AUTHOR 3 | 4 | Author: Walter Rowe 5 | Contact: walter@walterrowe.com 6 | 7 | Created: 28-Dec-2023 8 | Updated: 20-Aug-2024 9 | 10 | DESCRIPTION 11 | 12 | Ask user to choose the months, and a year range, and create a smart album with that criteria 13 | 14 | PREREQUISITES 15 | 16 | None 17 | *) 18 | 19 | use AppleScript version "2.8" 20 | use scripting additions 21 | 22 | property libraryFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/" 23 | property installFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/Capture One Scripts/" 24 | 25 | property installNames : {"Smart Album By Month"} 26 | property installType : ".scpt" -- ".scpt" for script, ".app" for script app 27 | property installIcon : false -- if true must have a droplet.icns icon file in the source folder and ".app" installType 28 | 29 | property requiresCOrunning : true -- true if capture one is required to be running 30 | property requiresCOdocument : true -- true, false, "catalog", "session" 31 | 32 | property appTesting : false -- if true, run in script editor, and if false install the script 33 | 34 | -- application specific properties below 35 | 36 | -- application specific properties above 37 | 38 | on run 39 | 40 | -- set required base variables 41 | set appName to my name 42 | set appPath to path to me 43 | 44 | -- make sure the CO script library is loaded 45 | set myLibrary to loadLibrary(appName) 46 | if myLibrary is missing value then return 47 | 48 | -- do install if not running under app name 49 | if installNames does not contain appName and not appTesting then 50 | myLibrary's installMe(appName, appPath, installFolder, installType, installNames, installIcon) 51 | return 52 | end if 53 | 54 | -- if app testing and we have multiple install names choose what action to perform 55 | if appTesting is true then 56 | if (count of installNames) > 1 then 57 | set appName to choose from list installNames with prompt "Choose Target Layer To Sync" 58 | if appName is false then return 59 | set appName to first item of appName 60 | else 61 | set appName to item 1 of installNames 62 | end if 63 | end if 64 | 65 | -- verify Capture One is running and has a document open 66 | set readyToRun to myLibrary's meetsRequirements(appName, requiresCOrunning, requiresCOdocument) 67 | if not readyToRun then return 68 | 69 | -- get path to Capture One's app icon 70 | set coIcon to path to resource "AppIcon.icns" in bundle (path to application "Capture One") 71 | 72 | -- ensure we have permission to interact with other apps 73 | myLibrary's activateUIScripting() 74 | 75 | -- application code goes below here 76 | 77 | set monthNames to {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"} 78 | set monthPicks to (choose from list monthNames with title "CHOOSE MONTH" with multiple selections allowed) 79 | if monthPicks is false then return 80 | 81 | set searchMonths to {} 82 | set searchNames to {} 83 | repeat with monthName in monthPicks 84 | repeat with idx from 1 to (count of monthNames) 85 | if item idx of monthNames is (monthName as string) then 86 | set end of searchMonths to idx 87 | set end of searchNames to (monthName as text) 88 | end if 89 | end repeat 90 | end repeat 91 | 92 | set textDelimiters to text item delimiters 93 | set text item delimiters to " " 94 | set searchNames to (searchNames as text) 95 | set text item delimiters to textDelimiters 96 | 97 | try 98 | set sYear to text returned of (display dialog "Enter Start Year:" default answer "" with icon coIcon buttons {"Continue", "Cancel"} default button "Continue") 99 | set eYear to text returned of (display dialog "Enter End Year:" default answer "" with icon coIcon buttons {"Continue", "Cancel"} default button "Continue") 100 | on error 101 | return 102 | end try 103 | 104 | set mySmartName to ((sYear as string) & " to " & (eYear as string) & " | " & searchNames) 105 | 106 | set sYear to sYear as integer 107 | set eYear to eYear as integer 108 | 109 | set mySmartRule to my createSmartRule(sYear, eYear, searchMonths) 110 | 111 | tell application "Capture One" 112 | tell front document 113 | set current collection to (make new collection with properties {name:mySmartName, kind:smart album, rules:mySmartRule}) 114 | end tell 115 | end tell 116 | 117 | set alertMessage to "Smart Album " & mySmartName & " created and selected." 118 | 119 | -- application code goes above here 120 | 121 | set alertTitle to appName & " Finished" 122 | 123 | set alertResult to (display alert alertTitle message alertMessage buttons {"OK"} giving up after 10) 124 | 125 | end run 126 | 127 | on createSmartRule(sYear, eYear, searchMonths) 128 | 129 | -- convert each month number into zero-filled two-digit string 130 | repeat with idx from 1 to count of searchMonths 131 | set searchMonth to (item idx of searchMonths) as string 132 | if length of searchMonth < 2 then set searchMonth to "0" & searchMonth 133 | set item idx of searchMonths to searchMonth 134 | end repeat 135 | 136 | set searchPrefix to "" 137 | set searchCriteria to "" 138 | repeat with idx from 1 to count of searchMonths 139 | repeat with thisYear from sYear to eYear 140 | set searchCriteria to searchCriteria & "_date_yearMonth0" & (thisYear as string) & "-" & item idx of searchMonths & "" 141 | end repeat 142 | end repeat 143 | set searchPostfix to "" 144 | set smartRule to searchPrefix & searchCriteria & searchPostfix 145 | 146 | return smartRule 147 | 148 | end createSmartRule 149 | 150 | ## 151 | ## download and install the latest CO script library 152 | ## 153 | 154 | on loadLibrary(appName as string) 155 | 156 | set myLibrary to libraryFolder & "COscriptlibrary.scpt" 157 | 158 | tell application "Finder" 159 | set libraryDownload to "curl -s -f https://raw.githubusercontent.com/walterrowe/capture-one-scripts/master/library/COscriptlibrary.applescript -o COscriptlibrary.applescript --output-dir " & libraryFolder 160 | set libraryCompile to "osacompile -x -o " & (quoted form of myLibrary) & " " & libraryFolder & "COscriptlibrary.applescript" 161 | try 162 | do shell script libraryDownload 163 | do shell script libraryCompile 164 | on error errorText 165 | -- failed to download and compile the latest library 166 | -- if we have a copy of the library installed then use it 167 | try 168 | exists (POSIX file myLibrary as alias) 169 | on error 170 | set myLibrary to POSIX path of myLibrary 171 | set alertResult to (display alert appName message "Unable to download and compile script library " & myLibrary & return & return & libraryDownload & return & return & libraryCompile & return & return & errorText buttons {"Quit"} giving up after 30) 172 | return missing value 173 | end try 174 | end try 175 | end tell 176 | 177 | try 178 | set myLibrary to load script myLibrary 179 | return myLibrary 180 | on error 181 | set myLibrary to POSIX path of myLibrary 182 | set alertResult to (display alert appName message "Unable to load script library " & myLibrary buttons {"Quit"} giving up after 30) 183 | return missing value 184 | end try 185 | 186 | end loadLibrary 187 | -------------------------------------------------------------------------------- /search-by-month/README.md: -------------------------------------------------------------------------------- 1 | # Search by Month 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | This script prompts for a month, and a start and end year. It then creates a smart album that searches for images created in that month in every year in the specified range. The smart album will be named "\ of \ to \" (eg. "Feb of 2020 to 2023"). 8 | 9 | ## Prerequisites 10 | 11 | None 12 | 13 | ## Installation 14 | 15 | The script self-installs in your Capture One Scripts folder. 16 | 17 | 1. Open the AppleScript file in macOS Script Editor. 18 | 1. Click the "Run this script" (▶) button. 19 | 1. Open Capture One and choose Scripts > Update Script Menu. 20 | 1. You now can run the script from the Capture One Scripts menu. 21 | 22 | ## How To Use 23 | 24 | After installing simply pick the script from the Capture One Scripts menu. 25 | 26 | 1. Open Capture One 27 | 1. Open the Scripts menu. 28 | 1. Select Update Scripts Menu (if necessary) 29 | 1. Choose "Search By Month". 30 | 1. Select one or more months from the pick list. 31 | 1. Enter Start Year 32 | 1. Enter End Year 33 | 34 | The new smart album will be created and automatically selected. 35 | 36 | ## Compatibility 37 | 38 | The utility has been tested on: 39 | 40 | - macOS Sonoma (Intel and M3 MacBook Pro) 41 | - Capture One 16.4 42 | - Moving to internal and external storage 43 | 44 | ## ChangeLog 45 | 46 | - 13 Aug 2024 - enhanced installer and requirements checks 47 | -------------------------------------------------------------------------------- /select-image-layer/Installer.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | AUTHOR 3 | 4 | Author: Walter Rowe 5 | Contact: walter@walterrowe.com 6 | 7 | Created: 10-Nov-2023 8 | Updated: 20-Aug-2024 9 | 10 | DESCRIPTION 11 | 12 | Select image (background) layer of selected variants (all variants if none selected) 13 | 14 | PREREQUISITES 15 | 16 | None 17 | *) 18 | 19 | use AppleScript version "2.8" 20 | use scripting additions 21 | 22 | property libraryFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/" 23 | property installFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/Capture One Scripts/" 24 | 25 | property installNames : {"Select Image Layer"} 26 | property installType : ".scpt" -- ".scpt" for script, ".app" for script app 27 | property installIcon : false -- if true must have a droplet.icns icon file in the source folder and ".app" installType 28 | 29 | property requiresCOrunning : true -- true if capture one is required to be running 30 | property requiresCOdocument : true -- true, false, "catalog", "session" 31 | 32 | property appTesting : false -- if true, run in script editor, and if false install the script 33 | 34 | -- application specific properties below 35 | 36 | -- application specific properties above 37 | 38 | ## 39 | ## use this to handle typical running from Capture One Scripts menu 40 | ## 41 | 42 | on run 43 | 44 | -- set required base variables 45 | set appName to my name 46 | set appPath to path to me 47 | 48 | -- make sure the CO script library is loaded 49 | set myLibrary to loadLibrary(appName) 50 | if myLibrary is missing value then return 51 | 52 | -- do install if not running under app name 53 | if installNames does not contain appName and not appTesting then 54 | myLibrary's installMe(appName, appPath, installFolder, installType, installNames, installIcon) 55 | return 56 | end if 57 | 58 | -- if app testing and we have multiple install names choose what action to perform 59 | if appTesting is true then 60 | if (count of installNames) > 1 then 61 | set appName to choose from list installNames with prompt "Choose Target Layer To Sync" 62 | if appName is false then return 63 | set appName to first item of appName 64 | else 65 | set appName to item 1 of installNames 66 | end if 67 | end if 68 | 69 | -- verify Capture One is running and has a document open 70 | set readyToRun to myLibrary's meetsRequirements(appName, requiresCOrunning, requiresCOdocument) 71 | if not readyToRun then return 72 | 73 | -- get path to Capture One's app icon 74 | set coIcon to path to resource "AppIcon.icns" in bundle (path to application "Capture One") 75 | 76 | -- ensure we have permission to interact with other apps 77 | myLibrary's activateUIScripting() 78 | 79 | -- application code goes below here 80 | 81 | tell application "Capture One" 82 | set selVarList to get selected variants 83 | if (count of selVarList) is 0 then set selVarList to all variants 84 | set varCount to count of selVarList 85 | set layerCount to 0 86 | repeat with thisVariant in selVarList 87 | tell thisVariant 88 | if current layer is not first layer then 89 | set current layer to first layer 90 | set layerCount to layerCount + 1 91 | end if 92 | end tell 93 | end repeat 94 | end tell 95 | 96 | set alertMessage to "Selected image layer on " & layerCount & " of " & varCount & " images." 97 | 98 | -- application code goes above here 99 | 100 | set alertTitle to appName & " Finished" 101 | 102 | set alertResult to (display alert alertTitle message alertMessage buttons {"OK"} giving up after 10) 103 | 104 | end run 105 | 106 | ## 107 | ## download and install the latest CO script library 108 | ## 109 | 110 | on loadLibrary(appName as string) 111 | 112 | set myLibrary to libraryFolder & "COscriptlibrary.scpt" 113 | 114 | tell application "Finder" 115 | set libraryDownload to "curl -s -f https://raw.githubusercontent.com/walterrowe/capture-one-scripts/master/library/COscriptlibrary.applescript -o COscriptlibrary.applescript --output-dir " & libraryFolder 116 | set libraryCompile to "osacompile -x -o " & (quoted form of myLibrary) & " " & libraryFolder & "COscriptlibrary.applescript" 117 | try 118 | do shell script libraryDownload 119 | do shell script libraryCompile 120 | on error errorText 121 | -- failed to download and compile the latest library 122 | -- if we have a copy of the library installed then use it 123 | try 124 | exists (POSIX file myLibrary as alias) 125 | on error 126 | set myLibrary to POSIX path of myLibrary 127 | set alertResult to (display alert appName message "Unable to download and compile script library " & myLibrary & return & return & libraryDownload & return & return & libraryCompile & return & return & errorText buttons {"Quit"} giving up after 30) 128 | return missing value 129 | end try 130 | end try 131 | end tell 132 | 133 | try 134 | set myLibrary to load script myLibrary 135 | return myLibrary 136 | on error 137 | set myLibrary to POSIX path of myLibrary 138 | set alertResult to (display alert appName message "Unable to load script library " & myLibrary buttons {"Quit"} giving up after 30) 139 | return missing value 140 | end try 141 | 142 | end loadLibrary 143 | -------------------------------------------------------------------------------- /select-image-layer/README.md: -------------------------------------------------------------------------------- 1 | # Select Image Layer 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | This script set the current layer to the base image layer for every selected variant. If no variants are selected then it sets the current layer for all variants in the current document. 8 | 9 | The original version of this script was provided by Zdeněk Macháček in the Capture One Support forum post [Select Background Layer all variants?](https://support.captureone.com/hc/en-us/community/posts/7116665276701-Select-Background-Layer-all-variants-) 10 | 11 | Original: Zdeněk Macháček © 2022 12 | 13 | Modifed: Walter Rowe 14 | 15 | ## Prerequisites 16 | 17 | None 18 | 19 | ## Installation 20 | 21 | The script self-installs in your Capture One Scripts folder. 22 | 23 | 1. Open the AppleScript file in macOS Script Editor. 24 | 1. Click the "Run this script" (▶) button. 25 | 1. Open Capture One and choose Scripts > Update Script Menu. 26 | 1. You now can run the script from the Capture One Scripts menu. 27 | 28 | ## Compatibility 29 | 30 | The utility has been tested on: 31 | 32 | - macOS Sonoma (Intel and M3 MacBook Pro) 33 | - Capture One 16.4 34 | 35 | ## ChangeLog 36 | 37 | - 13 Aug 2024 - enhanced installer and requirements checks 38 | -------------------------------------------------------------------------------- /settings-export-import/Installer.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | AUTHOR 3 | 4 | Author: Walter Rowe 5 | Contact: walter@walterrowe.com 6 | 7 | Created: 13-Dec-2023 8 | Updated: 20-Aug-2024 9 | 10 | DESCRIPTION 11 | 12 | This script creates or restores a ZIP of the transportable parts of these folders under ~/Library related to Capture One 13 | 14 | - Application Support/Capture One 15 | - Scripts/Capture One Scripts 16 | 17 | When restoring you must restart Capture One afterward for the app to see the restored settings. 18 | 19 | PREREQUISITES 20 | 21 | None 22 | *) 23 | 24 | use AppleScript version "2.8" 25 | use scripting additions 26 | 27 | property libraryFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/" 28 | property installFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/Capture One Scripts/" 29 | 30 | property installNames : {"Settings Export", "Settings Import"} 31 | property installType : ".scpt" -- ".scpt" for script, ".app" for script app 32 | property installIcon : false -- if true must have a droplet.icns icon file in the source folder and ".app" installType 33 | 34 | property requiresCOrunning : true -- true if capture one is required to be running 35 | property requiresCOdocument : true -- true, false, "catalog", "session" 36 | 37 | property appTesting : false -- if true, run in script editor, and if false install the script 38 | 39 | -- application specific properties below 40 | 41 | -- application specific properties above 42 | 43 | on run 44 | 45 | -- set required base variables 46 | set appName to my name 47 | set appPath to path to me 48 | 49 | -- make sure the CO script library is loaded 50 | set myLibrary to loadLibrary(appName) 51 | if myLibrary is missing value then return 52 | 53 | -- do install if not running under app name 54 | if installNames does not contain appName and not appTesting then 55 | myLibrary's installMe(appName, appPath, installFolder, installType, installNames, installIcon) 56 | return 57 | end if 58 | 59 | -- if app testing and we have multiple install names choose what action to perform 60 | if appTesting is true then 61 | if (count of installNames) > 1 then 62 | set appName to choose from list installNames with prompt "Choose Target Layer To Sync" 63 | if appName is false then return 64 | set appName to first item of appName 65 | else 66 | set appName to item 1 of installNames 67 | end if 68 | end if 69 | 70 | -- verify Capture One is running and has a document open 71 | set readyToRun to myLibrary's meetsRequirements(appName, requiresCOrunning, requiresCOdocument) 72 | if not readyToRun then return 73 | 74 | -- get path to Capture One's app icon 75 | set coIcon to path to resource "AppIcon.icns" in bundle (path to application "Capture One") 76 | 77 | -- ensure we have permission to interact with other apps 78 | myLibrary's activateUIScripting() 79 | 80 | -- application code goes below here 81 | 82 | set whereAmI to quoted form of POSIX path of appPath 83 | 84 | set settingsRoot to "~/Library/" 85 | set settingsFolders to "Application\\ Support/Capture\\ One/ Scripts/Capture\\ One\\ Scripts/" 86 | set settingsBackup to POSIX path of (path to desktop) & "CaptureOneSettings.zip" 87 | set settingsExclude to "-x '**Batch**' '**CaptureCore**' '**Diagnostics**' '**[Ee]rror**' '**IPCamera**' '**Plug-ins**' '**Sync**' '**/.DS_Store' '**Disabled**'" 88 | 89 | -- if we are running as the name "settings-export", create CaptureOneSettings.zip on the desktop 90 | if appName ends with "Export" then 91 | -- ask user to choose where to create the backup file 92 | set backupFolder to POSIX path of (choose folder with prompt "Select the folder place your backup file:" default location POSIX path of (path to desktop)) 93 | set settingsBackup to POSIX path of backupFolder & "CaptureOneSettings.zip" 94 | 95 | -- command to export settings to desktop 96 | set exportCmd to "eval $(/usr/libexec/path_helper -s); cd " & settingsRoot & ";zip -r " & settingsBackup & " " & settingsFolders & " " & settingsExclude 97 | 98 | try 99 | do shell script exportCmd 100 | on error errStr number errorNumber 101 | display dialog "ERROR: " & appBase & ": " & errStr & ": " & (errorNumber as text) with icon coIcon 102 | end try 103 | 104 | set alertMessage to "Exported settings to " & return & return & settingsBackup 105 | end if 106 | 107 | -- if we are running as the name "settings-import", restore CaptureOneSettings.zip from the desktop 108 | if appName ends with "Import" then 109 | -- ask user to choose the backup file to restore 110 | set settingsBackup to quoted form of POSIX path of (choose file with prompt "Select the settings backup file to restore" default location POSIX path of (path to desktop)) 111 | 112 | -- command to import settings from desktop 113 | set importCmd to "eval $(/usr/libexec/path_helper -s); unzip -o -d " & settingsRoot & " " & settingsBackup 114 | try 115 | do shell script importCmd 116 | on error errStr number errorNumber 117 | display dialog "ERROR: " & appBase & ": " & errStr & ": " & (errorNumber as text) & " " & settingsBackup with icon coIcon 118 | end try 119 | display dialog "Imported settings from " & settingsBackup & ". Please restart Capture One." with icon coIcon 120 | set alertMessage to "Settings imported from" & return & return & settingsBackup 121 | end if 122 | 123 | -- application code goes above here 124 | 125 | set alertTitle to appName & " Finished" 126 | 127 | set alertResult to (display alert alertTitle message alertMessage buttons {"OK"} giving up after 10) 128 | 129 | end run 130 | 131 | ## 132 | ## download and install the latest CO script library 133 | ## 134 | 135 | on loadLibrary(appName as string) 136 | 137 | set myLibrary to libraryFolder & "COscriptlibrary.scpt" 138 | 139 | tell application "Finder" 140 | set libraryDownload to "curl -s -f https://raw.githubusercontent.com/walterrowe/capture-one-scripts/master/library/COscriptlibrary.applescript -o COscriptlibrary.applescript --output-dir " & libraryFolder 141 | set libraryCompile to "osacompile -x -o " & (quoted form of myLibrary) & " " & libraryFolder & "COscriptlibrary.applescript" 142 | try 143 | do shell script libraryDownload 144 | do shell script libraryCompile 145 | on error errorText 146 | -- failed to download and compile the latest library 147 | -- if we have a copy of the library installed then use it 148 | try 149 | exists (POSIX file myLibrary as alias) 150 | on error 151 | set myLibrary to POSIX path of myLibrary 152 | set alertResult to (display alert appName message "Unable to download and compile script library " & myLibrary & return & return & libraryDownload & return & return & libraryCompile & return & return & errorText buttons {"Quit"} giving up after 30) 153 | return missing value 154 | end try 155 | end try 156 | end tell 157 | 158 | try 159 | set myLibrary to load script myLibrary 160 | return myLibrary 161 | on error 162 | set myLibrary to POSIX path of myLibrary 163 | set alertResult to (display alert appName message "Unable to load script library " & myLibrary buttons {"Quit"} giving up after 30) 164 | return missing value 165 | end try 166 | 167 | end loadLibrary 168 | -------------------------------------------------------------------------------- /settings-export-import/README.md: -------------------------------------------------------------------------------- 1 | # Export / Import Capture One Settings 2 | 3 | **Donations**: if you like these scripts and want to support them [buy me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | This AppleScript creates two scripts in the Capture One scripts menu. The scripts back up and restore the transportable contents of these folders under ~/Library: 8 | 9 | - Application Support/Capture One: tool presets, styles, keyboard maps, workspaces, export recipes, etc 10 | - Scripts/Capture One Scripts: scripts listed under the Scripts menu inside Capture One 11 | 12 | If you are viewing this in GitLab click the script name to see the source of the script. The press the download button at the top right of the script view panel. Double-click the downloaded script to open it in Script Editor, then run it. It creates two scripts in the Capture One Scripts folder. Placing them there lets you run them from the Scripts menu inside Capture One. 13 | 14 | - settings-export backs up ~/Library/ folders to CaptureOneSettings.zip in the folder you choose 15 | - settings-import restores ~/Library/ folders from the CaptureOneSettings.zip backup you choose 16 | 17 | They DO NOT back up and restore application preferences as it includes non-transportable content. Sadly this also means they do not back up and restore naming templates, current tool tab configuration, navigation bar settings, and other items stored in application preferences. 18 | 19 | ## Prerequisites 20 | 21 | None 22 | 23 | ## Installation 24 | 25 | The script self-installs in your Capture One Scripts folder. 26 | 27 | 1. Open the AppleScript file in macOS Script Editor. 28 | 1. Click the "Run this script" (▶) button. 29 | 1. Open Capture One and choose Scripts > Update Script Menu. 30 | 1. You now can run the script from the Capture One Scripts menu. 31 | 32 | ## Compatibility 33 | 34 | The utility has been tested on: 35 | 36 | - macOS Sonoma (Intel and M3 MacBook Pro) 37 | - Capture One 16.4 38 | 39 | ## ChangeLog 40 | 41 | - 21 Aug 2024 - converted to use COscriptlibrary handler library 42 | - 13 Aug 2024 - enhanced installer and requirements checks 43 | - 26 Jun 2024 - Updated this README.md 44 | - 16 Dec 2023 - Added folder and file choosers 45 | - 15 Dec 2023 - Include ~/Library/Scripts/Capture One Scripts to backup and restore 46 | - 13 Dec 2023 - initial version backs up and restores ~/Library/Application Support/Capture One 47 | -------------------------------------------------------------------------------- /sync-layer-adjustments/Installer.applescript: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/walterrowe/capture-one-scripts/ee494a8fc2cd3c29a30aa098c2149bda38788f70/sync-layer-adjustments/Installer.applescript -------------------------------------------------------------------------------- /sync-layer-adjustments/README.md: -------------------------------------------------------------------------------- 1 | # Synchronize Layers 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | This utility provides two operations. It lets you sync adjustments between two layers across selected variants, or sync a single layer across selected variants. These utilities do NOT synchronize layer masks. They ONLY sychronizes adjustments, luma masks, and opacity. 8 | 9 | 10 | - Sync Between Layers: Syncs adjustments between two layers of the same variant for a selection of variants. This simplifies syncing adjustments from existing adjustment layers to new dynamic masking layers. You can choose to disable the source layer after adjustments are copied. If a variant does not have either the source or target layer that variant is skipped. 11 | - Sync Layer Across Images: Syncs adjustments of the selected layer of the primary variant to a layer with the same name across selected target variants. You choose which layer to sync. If a target variant doesn't have that layer the target variant is skipped. 12 | 13 | If some target variants don't have a named layer they will be skipped. Each utility presents a results dialog showing synced and skipped counts. 14 | 15 | ## Prerequisites 16 | 17 | Each layer of a variant must have a unique name. The name is used to uniquely identify source and target layers on each variant. 18 | 19 | ## Installation 20 | 21 | The script self-installs in your Capture One Scripts folder. 22 | 23 | 1. Open the AppleScript file in macOS Script Editor. 24 | 1. Click the "Run this script" (▶) button. 25 | 1. Open Capture One and choose Scripts > Update Script Menu. 26 | 1. You now can run the script from the Capture One Scripts menu. 27 | 28 | ## How To Use 29 | 30 | Select variants in Capture One, then run the "Delete Selected Layers" from the Capture One Scripts menu. 31 | 32 | ## Compatibility 33 | 34 | The utility has been tested on: 35 | 36 | - macOS Sonoma (Intel and M3 MacBook Pro) 37 | - Capture One 16.5 38 | 39 | ## ChangeLog 40 | 41 | - 25 Oct 2024 - initial version 42 | -------------------------------------------------------------------------------- /template/AppTemplate.applescript: -------------------------------------------------------------------------------- 1 | (* 2 | AUTHOR 3 | 4 | Author: Walter Rowe 5 | Contact: walter@walterrowe.com 6 | 7 | Created: 8 | Updated: 9 | 10 | 1. Set installNames 11 | 2. Develop code 12 | 3. Provide app icon (optional, set installIcon to true) 13 | 4. Test code in Script Editor 14 | 5. Change appTesting to false 15 | 6. Test code in Capture One 16 | 17 | DESCRIPTION 18 | 19 | PREREQUISITES 20 | 21 | None 22 | *) 23 | 24 | property version : "1.0" 25 | 26 | use AppleScript version "2.8" 27 | use scripting additions 28 | 29 | property libraryFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/" 30 | property installFolder : ((POSIX path of (path to home folder)) as string) & "Library/Scripts/Capture One Scripts/" 31 | 32 | property installNames : {"App Name"} 33 | property installType : ".scpt" -- ".scpt" for script, ".app" for script app 34 | property installIcon : false -- if true must have a droplet.icns icon file in the source folder and ".app" installType 35 | 36 | property requiresCOrunning : true -- true if capture one is required to be running 37 | property requiresCOdocument : true -- true, false, "catalog", "session" 38 | 39 | property appTesting : true -- if true, run in script editor, and if false install the script 40 | 41 | -- application specific properties below 42 | 43 | -- application specific properties above 44 | 45 | ## 46 | ## use this to handle typical running from Capture One Scripts menu 47 | ## 48 | 49 | on run 50 | 51 | -- set required base variables 52 | set appName to my name 53 | set appPath to path to me 54 | 55 | -- make sure the CO script library is loaded 56 | set myLibrary to loadLibrary(appName) 57 | if myLibrary is missing value then return 58 | 59 | -- do install if not running under app name 60 | if installNames does not contain appName and not appTesting then 61 | myLibrary's installMe(appName, appPath, installFolder, installType, installNames, installIcon) 62 | return 63 | end if 64 | 65 | -- if app testing and we have multiple install names choose what action to perform 66 | if appTesting is true then 67 | if (count of installNames) > 1 then 68 | set appName to choose from list installNames with prompt "Choose Target Layer To Sync" 69 | if appName is false then return 70 | set appName to first item of appName 71 | else 72 | set appName to item 1 of installNames 73 | end if 74 | end if 75 | 76 | -- verify Capture One is running and has a document open 77 | set readyToRun to myLibrary's meetsRequirements(appName, requiresCOrunning, requiresCOdocument) 78 | if not readyToRun then return 79 | 80 | -- get path to Capture One's app icon 81 | set coIcon to path to resource "AppIcon.icns" in bundle (path to application "Capture One") 82 | 83 | -- ensure we have permission to interact with other apps 84 | myLibrary's activateUIScripting() 85 | 86 | -- application code goes below here 87 | 88 | tell application "Capture One" 89 | set docKind to myLibrary's getCOtype(current document) 90 | tell current document to set docName to name 91 | tell current document to set docPath to POSIX path of (path as alias) as string 92 | end tell 93 | 94 | set alertMessage to "your informational text for script completion" 95 | 96 | -- application code goes above here 97 | 98 | set alertTitle to appName & " Finished" 99 | 100 | set alertResult to (display alert alertTitle message alertMessage buttons {"OK"} giving up after 10) 101 | 102 | end run 103 | 104 | ## 105 | ## use this to handle scripts that accept drag-n-drop 106 | ## 107 | 108 | on open droppedItems 109 | end open 110 | 111 | ## 112 | ## download and install the latest CO script library 113 | ## 114 | 115 | on loadLibrary(appName as string) 116 | 117 | set myLibrary to libraryFolder & "COscriptlibrary.scpt" 118 | 119 | tell application "Finder" 120 | set libraryDownload to "curl -s -f https://raw.githubusercontent.com/walterrowe/capture-one-scripts/master/library/COscriptlibrary.applescript -o COscriptlibrary.applescript --output-dir " & libraryFolder 121 | set libraryCompile to "osacompile -x -o " & (quoted form of myLibrary) & " " & libraryFolder & "COscriptlibrary.applescript" 122 | try 123 | do shell script libraryDownload 124 | do shell script libraryCompile 125 | on error errorText 126 | -- failed to download and compile the latest library 127 | -- if we have a copy of the library installed then use it 128 | try 129 | exists (POSIX file myLibrary as alias) 130 | on error 131 | set myLibrary to POSIX path of myLibrary 132 | set alertResult to (display alert appName message "Unable to download and compile script library " & myLibrary & return & return & libraryDownload & return & return & libraryCompile & return & return & errorText buttons {"Quit"} giving up after 30) 133 | return missing value 134 | end try 135 | end try 136 | end tell 137 | 138 | try 139 | set myLibrary to load script myLibrary 140 | return myLibrary 141 | on error 142 | set myLibrary to POSIX path of myLibrary 143 | set alertResult to (display alert appName message "Unable to load script library " & myLibrary buttons {"Quit"} giving up after 30) 144 | return missing value 145 | end try 146 | 147 | end loadLibrary 148 | -------------------------------------------------------------------------------- /template/README.md: -------------------------------------------------------------------------------- 1 | # App Name 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | ## Prerequisites 8 | 9 | ## Installation 10 | 11 | The script self-installs in your Capture One Scripts folder. 12 | 13 | 1. Open the AppleScript file in macOS Script Editor. 14 | 1. Click the "Run this script" (▶) button. 15 | 1. Open Capture One and choose Scripts > Update Script Menu. 16 | 1. You now can run the script from the Capture One Scripts menu. 17 | 18 | ## How To Use 19 | 20 | ## Compatibility 21 | 22 | The utility has been tested on: 23 | 24 | - macOS Sonoma (Intel and M3 MacBook Pro) 25 | - Capture One 16.4 26 | 27 | ## ChangeLog 28 | 29 | - DD Mon YYYY - initial version 30 | -------------------------------------------------------------------------------- /time-lapse-smoothing/Installer.applescript: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/walterrowe/capture-one-scripts/ee494a8fc2cd3c29a30aa098c2149bda38788f70/time-lapse-smoothing/Installer.applescript -------------------------------------------------------------------------------- /time-lapse-smoothing/README.md: -------------------------------------------------------------------------------- 1 | # Time Lapse Smoothing 2 | 3 | **Donations**: if you like to keep these scripts free please consider [buying me a coffee](https://buymeacoffee.com/walterrowe). 4 | 5 | ## Description 6 | 7 | Time Lapse Smoothing enables you to quickly and efficiently adjust the exposure and white balance temperature across an entire time lapse sequence of exposure sets to achieve that smooth gradation of exposure and white balance. 8 | 9 | ### Exposure Smoothing 10 | 11 | In a time lapse sequence the ambient light and the light color temperature change near linearly as the sun rises or sets. The photographer cannot match this linear progression because cameras can only change exposure in fixed increments of 1/3rd stop or more. The photographer is forced to capture multiple exposure sets at fixed stop increments of increasing or decreasing shutter speeds to compensate for a setting or rising sun. Where the camera's exposure changes for the next frame set the images reflect a non-linear "jump" or "drop" in the exposure. 12 | 13 | If you take a 300-frame time lapse sequence and increase or decrease the exposure time (shutter speed) by 1/3rd of a stop every 10 frames, you end up with 30 sets of 10 frames each. Each frame in a frame set will have the same exposure. The exposure time in each successive frame set will change by the increment programmed into the camera until the entire time lapse sequence has been captured. Where the camera's exposure setting changes at each new frame set you see a dramatic jump or drop in light when you view the images on your computer. 14 | 15 | The script steps through every frame in the time lapse sequence, setting the Capture One exposure of each frame to linearly smooth out this jump or drop to match how the natural light changes. 16 | 17 | ### White Balance Smoothing 18 | 19 | As the sun rises or sets, the camera's white balance must change to match the changing light. We can't program the camera to do that so we must do it in post processing. Prior to running this script you will set the correct white balance for the first and last frame of the time lapse sequence. The script gets the difference in temperature between the first and last frame and divides it by the total number of frames in the sequence. This gives you a temperature delta to apply frame to frame starting with the first frame's temperature all the way to the last frame's temperature. 20 | 21 | Imagine you set the white balance temperature of the first frame to 5200 Kelvin and the last frame to 3100 Kelvin. The difference is 2100 Kelvin. If you have a 300-frame sequence, and divide 2100 Kelvin by 300 frames, you get 70 Kelvin per frame you need to apply linearly from first to last frame. The first frame will have no WB change (5200K). The second frame will have the WB of the first frame adjusted by -70 (5030K). The third frame will have the WB of the second frame adjusted by -70 (4960K). This progresses across the entire sequence down to the last frame's 3100K. 22 | 23 | This smooths out the white balance temperature of the time lapse sequence to match how the natural light changes. 24 | 25 | ## Prerequisites 26 | 27 | None. 28 | 29 | ## Installation 30 | 31 | The script self-installs in your Capture One Scripts folder. 32 | 33 | 1. Open the AppleScript file in macOS Script Editor. 34 | 1. Click the "Run this script" (▶) button. 35 | 1. Open Capture One and choose Scripts > Update Script Menu. 36 | 1. You now can run the script from the Capture One Scripts menu. 37 | 38 | ## How To Use 39 | 40 | Set the white balance temperature of the first and last frame for the entire time lapse sequence, select ALL frames of the entire time lapse sequence, then run the script. 41 | 42 | Time Lapse Smoothing assumes that every exposure set across a time lapse sequence has the same number of images (eg. 10 frames at 2 secs, 10 frames at 4 secs, 10 frames at 6 secs, etc). 43 | 44 | The script attempts to determine how many frames are in each exposure set by searching for the first change in exposure time (shutter speed). It then asks for confirmation for this number and allows you change it if it is incorrect. 45 | 46 | The script then asks for the exposure increment in stops (between -1 and +1 in 1/3 increments). 47 | 48 | Using the number of frames in each exposure set and exposure increment, and the white balance temperature of the first and last frame of the entire sequence, the script then adjusts the color temperature and exposure of each frame to linearly smooth them out across the entire time lapse sequence. 49 | 50 | A pop-up dialog will appear when it is done showing how long it took and how many frames were adjusted. 51 | 52 | ## Compatibility 53 | 54 | The utility has been tested on: 55 | 56 | - macOS Sequoia 57 | - Capture One 16.5 58 | 59 | ## ChangeLog 60 | 61 | - 24 Jan 2025 - initial version 62 | --------------------------------------------------------------------------------