Select by variant position and sequence ID
I'm looking to combine two menu items as I work with phase one focus stacked files a lot.
I would like to select all variants of a particular position within the same sequence ID.
Im struggling a bit to bring a script together. I normally only work with selected variants for my scripts....
any hints would be much appreciated
-
It seems like the Sequence ID is not available except for use as sorting order. However I can see it in the metadata panel....
Sequence ID seems to be a combination of Serial Number of the camera _ a 6 digit code. anyone go any idea where to get it from, can't find it in the documentation.
the below works.., however its not my aim
tell document 1 of application "Capture One 21"
set sorting order of current collection to by sequence ID
end tell
0 -
Script Debugger's dictionary reader tells me that sort order is the only Applescript reference to Capture One's Sequence ID.
The only way forward that I can see is for Applescript to read the source file's Exif using exiftool. Before investing in this, run exiftool manually from terminal to determine that it can in fact read Sequence ID from the image files EXIF (or the XMP's Exif).
0 -
Brilliant ill check that thanks Eric. Ill report back when I've tried
0 -
Here is some code from one of my scripts
on processVariantList(variantPathList)
global debugLogEnable, debugLogEnable, enableExifStringFilter, ExifSearchString, enableExifTagSearch, ExifTagList
local ExifToolArg_s, ExifGrepString, ExifResults
set ExifToolArg_s to "/usr/local/bin/exiftool "
if enableExifTagSearch then
set ExifTag_s to "-ExifToolVersion -FileName -Directory -" & U's joinListToString(ExifTagList, " -") & " "
else
set ExifTag_s to ""
end if
if enableExifStringFilter then
set ExifGrepString to " | grep -i -e " & (quoted form of ExifSearchString) & " -e 'FileName' -e 'Directory' -e 'ExifToolVersion'"
else
set ExifGrepString to ""
end if
repeat with thePath_s in variantPathList
set ExifToolArg_s to ExifToolArg_s & ExifTag_s & (quoted form of (get thePath_s)) & " -execute "
end repeat
set ExifToolArg_s to ExifToolArg_s & " -common_args -G -s " & ExifGrepString
set ExifResults to do shell script ExifToolArg_s
set ExifResults to U's replaceText(ExifResults, "[ExifTool]", ("==========" & return & "[ExifTool]"))
L's loq_Results2(-1, false, (return & ExifResults))
return
end processVariantListon validateExifTool()
global debugLogEnable
try
set exifToolVer to do shell script "/usr/local/bin/exiftool -ver"
if debugLogEnable then L's loq_Results2(3, false, ("ExifTool version is: " & exifToolVer))
on error errorText number errorNumber
if (127 = errorNumber) then
set exifToolMissing_s to "Can't find the application \"ExifTool\"" & return & "Install latest MacOS \"exiftool\" from:" & return & "https://sno.phy.queensu.ca/~phil/exiftool/ "
L's loqqed_Error_Halt3(true, exifToolMissing_s)
else
L's loqqed_Error_Halt3(true, ("Error " & errorNumber & ": " & errorText))
end if
end try
end validateExifTool0 -
brilliant thanks Eric
0 -
Well as it turns out, the property is not available on exiftools so I did it via the filename which has the focus stacking property included.
My filenames if stacked end like this _Focus Stacking10_0011.eip.
Thus the script removes the last 11 characters to work on matching the filenames see below
not sure if there is a faster way but seems reasonably quick...
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set sVariants to {}
tell application "Capture One 21"
set selectedVariants to (get selected variants)
if selectedVariants is {} then
display notification "No images selected - select one or more images"
else
set theVariant to item 1 of selectedVariants
set pos to position of theVariant
set pName to name of parent image of theVariant as string
set l to length of pName
set l to l - 11
set pName to text 1 through l of pName
end if
set allVariants to variants of current collection of current document
repeat with counter from 6 to count of allVariants
set thisVariant to item counter of allVariants
set sName to name of parent image of thisVariant as string
set sName to text 1 through l of sName
if extension of parent image of thisVariant is not equal to "TIF" then
if sName is equal to pName then
if position of thisVariant is equal to pos then
set end of sVariants to thisVariant
--select current document variant thisVariant
end if
end if
end if
end repeat
--return sVariants
select current document variants sVariants
end tell
0
投稿コメントは受け付けていません。
コメント
6件のコメント