Page 1 of 1

Capture done script property Capture One 11

PostPosted: Fri Jun 29, 2018 8:15 am
by Pat78
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!

Re: Capture done script property Capture One 11

PostPosted: Fri Jun 29, 2018 1:28 pm
by ben_US
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.

Re: Capture done script property Capture One 11

PostPosted: Fri Jun 29, 2018 6:28 pm
by Pat78
@ben_US Sorry, didn't know. I'm pretty new into scripting. Do you have an example how to use it?

Thanks,

Patrick

Re: Capture done script property Capture One 11

PostPosted: Sat Jun 30, 2018 4:56 am
by Eric Nepean
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

Re: Capture done script property Capture One 11

PostPosted: Sun Jul 01, 2018 6:11 am
by Pat78
Wow Eric, Thanks! This pointed me in the right direction.
I'm going to play around with it.

Thanks

Patrick