Capture done script property Capture One 11

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

Capture done script property Capture One 11

Postby Pat78 » Fri Jun 29, 2018 8:15 am

In the library of Capture One 11 there's an new property called "Capture done script" with get/set acces. Does anyone has an example on how to use this property in a script.

I want to use it for Copying the capture name into the status title of the metadata after Capturing an image.

Thanks!
Pat78
 
Posts: 25
Joined: Tue Sep 19, 2017 10:00 am

Re: Capture done script property Capture One 11

Postby ben_US » Fri Jun 29, 2018 1:28 pm

This has been around for a bit, fwiw. It only has one value - the .scpt file that gets called when a transfer from a tethered camera is complete.
ben_US
Crew
Crew
 
Posts: 677
Joined: Mon Feb 01, 2016 9:51 pm
Location: New York, USA

Re: Capture done script property Capture One 11

Postby Pat78 » Fri Jun 29, 2018 6:28 pm

@ben_US Sorry, didn't know. I'm pretty new into scripting. Do you have an example how to use it?

Thanks,

Patrick
Pat78
 
Posts: 25
Joined: Tue Sep 19, 2017 10:00 am

Re: Capture done script property Capture One 11

Postby Eric Nepean » Sat Jun 30, 2018 4:56 am

Hiya Pat

Heres a simple way of using the script.

Suppose that that you save your script as myCaptureDoneV1.scpt in folder ~/Documents/Scripts, and that your user IDthe short name for your user folder on your mac is "pat".

To use it, then you would execute this Applescript when you set up Captures:
Code: Select all
tell application "Capture One 11"
   set batch done script to alias "Macintosh HD:Users:pat:Documents:Scripts:myCaptureDoneV1.scpt"
end tell
BTW here is a relevant posting https://forum.phaseone.com/En/viewtopic.php?f=70&t=27265&p=128991&hilit=capture+done+script#p128991

In myCaptureDoneV1.scpt you can write whatever Applescript you want to run after the image is captured, using "Script Editor".

The difficulty is finding the last image captured. capture name is the current next capture name, not the name of the image just captured.
The only record of the image just captured is last captured file (file, r/o) : The last captured image file.

A simple way to proceed is to assume that C1 is set up so that the browser organises the images in date or name order, and so the last capture is simply the last variant and last image. that leads to the following script for myCaptureDoneV1.scpt Simple, but not robust.
Code: Select all
 tell application "Capture One 11" to tell current document
   set thevariant to the last variant
   set thename to get name of last image
   set status title of thevariant to thename
end tell
## not debugged

A more complicated approach, which should be quite robust, is to find the image attached to last captured file
Code: Select all
tell application "Capture One 11" to tell current document
   if missing value = last captured file then
      error "File information for the last captured file is missing"
   else
      try
         set theImage to the first image whose file is last captured file
         set theVariant to the first variant whose parent image is theImage
         set status title of theVariant to get name of theImage
      on error
         error "Could not find the image associated with the lat captured file"
      end try
   end if
end tell
## not debugged
Eric Nepean
 
Posts: 608
Joined: Sat Oct 25, 2014 8:02 am
Location: Ottawa

Re: Capture done script property Capture One 11

Postby Pat78 » Sun Jul 01, 2018 6:11 am

Wow Eric, Thanks! This pointed me in the right direction.
I'm going to play around with it.

Thanks

Patrick
Pat78
 
Posts: 25
Joined: Tue Sep 19, 2017 10:00 am


Return to Scripting



Who is online

Users browsing this forum: No registered users and 1 guest