Open Catalog based on filename
I have recently started using Capture On12 and have followed advice and split my collection of images into several medium sized catalogs. My images are stored in the Finder in folders named after the year of capture e.g. /2019 stores this years images. I would like to be able to review these images using the Finder or a 3rd party DAM and open a selected image into Capture One for viewing and editing.
The first four characters of the image name specifies the year it was taken so also defines the parent folder. My Capture On Catalogs are also based on years e.g. "All_Images2016_2019" meaning that the year can be used to identify which catalog stores the image record.
I would like to write a script that parses the name of any image passed to it, determines which Capture One Catalog holds the image and then opens the catalog in Capture One. The icing on the cake would be to have the target image selected in some way ready for review.
Do you think that such a script is possible?
best wishes
Simon
The first four characters of the image name specifies the year it was taken so also defines the parent folder. My Capture On Catalogs are also based on years e.g. "All_Images2016_2019" meaning that the year can be used to identify which catalog stores the image record.
I would like to write a script that parses the name of any image passed to it, determines which Capture One Catalog holds the image and then opens the catalog in Capture One. The icing on the cake would be to have the target image selected in some way ready for review.
Do you think that such a script is possible?
best wishes
Simon
0
-
I've made a start by "borrowing code found on this forum" . I am unable to test as I'm doing a new import that will take hours.
Proof of concept with hard coded variables .use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set tTargetImageName to "NameOfImageToDisplay"
--tell application "Finder" to open :Users:skids:Pictures:Capture_One_Catalog.cocatalog
tell application "Capture One 12" to open POSIX file "/Users/skids/Pictures/Capture_One_Catalog.cocatalog"
tell application "Capture One 12" to tell current document
set current collection to collection "All Images"
set AllVariants to (get variants)
set countOfVariants to count of AllVariants
set everyImageIDList to get id of every image
--set everyImageIDList to get name of every image
repeat with v_Counter from 1 to countOfVariants
set thisVariant to item v_Counter of AllVariants
set searchedImage to (get parent image of thisVariant)
set searchedImageName to (get name of searchedImage)
if searchedImageName = tTargetImageName then
set searchedImageID to (get id of searchedImage)
select the image searchedImageID
exit repeat
end if
end repeat
end tell0
Post is closed for comments.
Comments
1 comment