Metadata and original file name script
I am new to AppleScript and have completed a little script that you may find useful. Thanks to some help and other's code I was able to hack this script together.
I wanted to solve two problems.
1. Fill in metadata that is missing like my email address and web sit and other things. Found a nice example in this form and expanded on it. Please change the information in "Quotes" to your info!
2. The other problem is being able to track the origin of the RAW file from the JPG version. When you Process an image there is no way to know where or what the original RAW file is located. In the Metadata is store the current file name so my guess if some renames the file you can look at the Metadata and get the JPG file name. I use Sessions (Not sure how well this will work for Catalogs) and the folder structure is very logical so it is easy to follow on backups and so on. Here is my directory structure, /PhotosMaster/Photo2017/SCPT Test/Capture/September/_DSC5666.NEF As you can see I have a folder called PhotoMaster just to clean. Next I have a folder called Photo2017 this gives me a year and generally the folder I back up to a USB drive. Next is the Session name and lastly the file name. This information I decided to store in Getty, Original Filename, not sure what is field is intended for but seems to work for me.
Feel free to use this and and as always comments and suggestions are welcome.
Just a hack!
Bill
[code]tell application "Capture One 10"
set selectedVariants to (get selected variants)
tell document 1 -- as far as I can tell there is only ever 1 document
if selectedVariants is {} then
display notification "No images selected - select one or more images"
else
repeat with |counter| from 1 to count of selectedVariants
set thisVariant to item |counter| of selectedVariants
set contact city of thisVariant to "Strasbourg"
set contact country of thisVariant to "France"
set contact address of thisVariant to "House 4"
set contact state of thisVariant to "Alsace"
set contact creator of thisVariant to "Joe Bloggs"
set contact creator job title of thisVariant to "Photographer"
set contact postal code of thisVariant to "12345"
set contact phone of thisVariant to "+00 123 456 789"
set contact email of thisVariant to "joe.bloggs@Gmail.com"
set contact website of thisVariant to "joebloggs.com"
end repeat
end if
end tell
end tell
--- This section gets the original file name and path and places it in the Personality, Original Filename field.
tell application "Capture One 10"
set my_variants to selected variants
repeat with jack in my_variants
set ParentI to (get parent image of jack)
set Path_ to path of ParentI
set Getty original filename of jack to (Path_)
end repeat
end tell/code]
-
2. The other problem is being able to track the origin of the RAW file from the JPG version. When you Process an image there is no way to know where or what the original RAW file is located. In the Metadata is store the current file name so my guess if some renames the file you can look at the Metadata and get the JPG file name. I use Sessions (Not sure how well this will work for Catalogs) and the folder structure is very logical so it is easy to follow on backups and so on. Here is my directory structure, /PhotosMaster/Photo2017/SCPT Test/Capture/September/_DSC5666.NEF As you can see I have a folder called PhotoMaster just to clean. Next I have a folder called Photo2017 this gives me a year and generally the folder I back up to a USB drive. Next is the Session name and lastly the file name. This information I decided to store in Getty, Original Filename, not sure what is field is intended for but seems to work for m
Good idea, though it is worth mentioning that the "Include All Other" must be enabled under your JPG process recipe to embed this information into the resulting JPG.0 -
Good point! Not sure if I checked this or if this is the default to have include all other.
Thanks for the reply.
Bill0 -
It is the default behavior, but perhaps it would be worth it to include in the tell anyway: set include Other Metadata of recipe [--your quoted recipe name here] to True
0 -
Hey there, I am also interested in preserving Original Filename in metadata
Please help me, how do I run this script .. ??
(Or how do I copy Filename in IPTC-Getty field ? )
0 -
In AppleScript use the field "Getty original filename"
tell application "Capture One"
set listOfVariants to (get selected variants)
repeat with thisVariant in listOfVariants
tell thisVariant to set Getty original filename to name
end repeat
end tellI ran this on some variants and it does exactly what I describe.
0 -
any method for win10-64bit ?
0 -
Scripting is not supported for Capture One on Windows. :-(
0 -
it doesn't need to be done inside CO.
I need a simple tool to copy filenames of images to EXIF/IPTC before editing them
0 -
Look at exiftool.
0 -
Thanks, I 'm not into command line programs..
I used Photo Mechanic.
Although didn't find the specific Getty field,
I did copy original filename to another IPTC field.It was instant !
0
Post is closed for comments.
Comments
10 comments