Metadata and original file name script

Discussion regarding all scripting related questions
Please DO NOT post to this thread anything that is not directly related to scripting of Capture One.

Metadata and original file name script

Postby Wandy » Mon Oct 02, 2017 9:38 am

Hi All,

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]
Last edited by Jim_DK on Mon Oct 02, 2017 11:09 am, edited 1 time in total.
Reason: Removed Personal data
Wandy
 
Posts: 5
Joined: Thu Nov 29, 2012 9:32 pm

Re: Metadata and original file name script

Postby ben_US » Mon Oct 02, 2017 8:55 pm

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.
Please make a support case for Technical Support with Capture One software:
http://support.phaseone.com and click on Contact Support, then select Technical Support.
ben_US
Crew
Crew
 
Posts: 318
Joined: Mon Feb 01, 2016 9:51 pm
Location: New York, USA

Re: Metadata and original file name script

Postby Wandy » Tue Oct 03, 2017 5:20 pm

Good point! Not sure if I checked this or if this is the default to have include all other.

Thanks for the reply.
Bill
Wandy
 
Posts: 5
Joined: Thu Nov 29, 2012 9:32 pm

Re: Metadata and original file name script

Postby ben_US » Wed Oct 04, 2017 5:23 pm

It is the default behavior, but perhaps it would be worth it to include in the tell anyway:

Code: Select all
set include Other Metadata of recipe [--your quoted recipe name here] to True
Please make a support case for Technical Support with Capture One software:
http://support.phaseone.com and click on Contact Support, then select Technical Support.
ben_US
Crew
Crew
 
Posts: 318
Joined: Mon Feb 01, 2016 9:51 pm
Location: New York, USA


Return to Scripting



Who is online

Users browsing this forum: No registered users and 1 guest