Copy Filename to "Title" Metadata Field
I found this same question is the legacy discussion board for Capture One 8, but there was still no answer for this one so I thought I'd throw it over this way.
I'd like to find an automated way to copy the filename of each image into the title field without doing it manually for every image. Because of the way Squarespace functions, I need the filename to be in the title field so it will be displayed when clients are previewing images. I found a work around code for Squarespace that will allow the filename to be displayed below the thumbnail version, but I need the filename in the title field for it to appear when the image is opened up the larger lightbox. Any suggestions are greatly appreciated.
Thanks!
I'd like to find an automated way to copy the filename of each image into the title field without doing it manually for every image. Because of the way Squarespace functions, I need the filename to be in the title field so it will be displayed when clients are previewing images. I found a work around code for Squarespace that will allow the filename to be displayed below the thumbnail version, but I need the filename in the title field for it to appear when the image is opened up the larger lightbox. Any suggestions are greatly appreciated.
Thanks!
0
-
A simple Applescript will do it. Are you comfortable running Applescript? If so, we should move this conversation to the Scripting forum. 0 -
I have never run AppleScript but am more than happy to learn if it will help. I’m sure with the proper guidance I can figure it out. Thanks! 0 -
@Jim_DK Can you move this thread to the scripting forum, please 0 -
This Applescript below should do the job on every variant in the user collection you have selected (which is currently shown in the window). I've tested it and it works.
The posting at this link has an informal tutorial of how to get started and run an Applescript with Capture One:use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
tell application "Capture One 11" to tell current document to tell current collection
repeat with thisVariantIndex from 1 to count of every variant
set imagePathName to path of parent image of variant thisVariantIndex
if length of imagePathName = 0 then
log ("could not get path of Image " & (get name of variant thisVariantIndex))
else
set ImageFileName to last item of my splitStringToList(imagePathName, "/")
tell variant thisVariantIndex to set status title to ImageFileName
end if
end repeat
end tell
on splitStringToList(theString, theDelim)
set astid to AppleScript's text item delimiters
try
set AppleScript's text item delimiters to theDelim
set theList to text items of theString
on error
set AppleScript's text item delimiters to astid
end try
set AppleScript's text item delimiters to astid
return theList
end splitStringToList1 -
Thanks Eric! I'll give this a try and see if I can get it to work. 0 -
Variant Class contains name property so there is no need to parse the parent image path you can just call the property directly. This works for both CO10 and 11
tell application "Capture One 10" to tell current document to tell current collection
repeat with thisVariantIndex from 1 to count of every variant
set TheName to name of parent image of variant thisVariantIndex
tell variant thisVariantIndex to set status title to TheName
end repeat
end tell0 -
Good point, thanks Rick. 0 -
Hey Rick!
Nice one. Is there a way for me to incorporate removing the trailing number counter i.e. -003 within this script?
Cheers
Matt0 -
Hey Jensen
If its always the last 4 characters then below should work. If you need to remove anything after the dash then thats going to cost a beer 😂tell application "Capture One 10" to tell current document to tell current collection
repeat with thisVariantIndex from 1 to count of every variant
set TheName to name of parent image of variant thisVariantIndex
tell app "finder" to set theNameS to text 1 thru -4 of TheName
tell variant thisVariantIndex to set status title to theNameS
end repeat
end tell0 -
Haha! You know it!
6 Pack? I am doing everything I can to get this studio off LR. It is sucking my soul away.0 -
I'm sure there is a more elegant way but its been a big day on set.
Beers in Bondi Matt next month...tell application "Capture One 10" to tell current document to tell current collection
repeat with thisVariantIndex from 1 to count of every variant
set TheName to name of parent image of variant thisVariantIndex
set astid to AppleScript's text item delimiters
set AppleScript's text item delimiters to "-"
set theNameS to text 1 thru text item -2 of TheName
set AppleScript's text item delimiters to astid
tell variant thisVariantIndex to set status title to theNameS
end repeat
end tell0 -
Rick Allen I'm trying to achieve the same thing but on Capture One 2023. Do you think this script will work on it? :D
0 -
Yeah not much has changed to the library nothing that would break this.
0
Post is closed for comments.
Comments
13 comments