Scripting Collections in Capture One 12

21 Dec 2018 ∞

A few weeks ago Phase One released Capture One 12 with a slick new interface, support for plug-ins, and a fix for one of my }}">pet bugs (I call it Ralph). There are also a handful of new properties that allow workflows to be automated.

With the release I've updated all of my scripts for Capture One 12.

User Property

Capture One collections include a new user property to help differentiate the session's collections from a user's favorites.

With this new property finding favorites is fairly simple:

tell front document of application "Capture One 12"
    set theFolder to captures
    set captureCollection to item 1 of (collections whose folder is theFolder and user is true)
end tell

This is also the key to making my capture folder navigation scripts work again.


Another new feature is the sort order property, which allows a script to sort a collection by over a dozen different keys. The main use I've found for this is easy, automated batch renaming.

tell front document of application "Capture One 12"
    --  Sort by date
    set sorting order of current collection to by date
    set sorting reversed of current collection to false
end tell

Previously batch renaming was a multi-step manual process:

  1. Sort by the desired key
  2. Select all
  3. Reset the renaming counter
  4. Batch rename

All of these steps could be mapped to keyboard shortcuts, but who has time for that? A short script will do all of those steps in a single action. Paired with a few more lines of code, the script could move between all favorites and rename an entire session with in a single go.

Bonus: Progress Reporting

Anyone who has run a larger script that handles a lot of files has certainly run into the fact that Capture One blocks user input while a script is running. While this isn't solved in 12, scripts can at least indicate they're still running with the progress properties.

The progress is displayed in the same view as other Capture One progress bars.

tell application "Capture One 12"
    -- progress set up
    set progress total units to 10
    set progress completed units to 0
    set progress text to "Doing important things"

    -- for each task
    set progress completed units to progress completed units + 1
    set progress additional text to "Details about the important thing"
end tell