Session Creator not 100% reliable

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

Session Creator not 100% reliable

Postby Pat78 » Tue Sep 04, 2018 9:50 am

Hi Guys,

For our specific studio workflow i've created this session creator. See script below.
But the last part of the script (Output path and capture name format) is not 100% reliable.
Most of the time it works fine, but sometimes the capture name format is not set to the token "Name"
And sometimes the Output is not set to the path that given earlier in the script.

Does anyone know how to make this work all the time? Some bug fixes?

Thanks a lot!

Patrick



Code: Select all
-- Finder
display dialog "Name photographer?" default answer ""
set fotograaf to the text returned of the result
display dialog "Name Stylist?" default answer ""
set stylist to the text returned of the result
display dialog "Photo Unit? (Number only)" default answer ""
set unit to the text returned of the result

mount volume "afp://WELPNASZW004.local/FotoData"
tell application "Finder"
   set outputFolder to make new folder at folder "output" of folder "product fotografie" of folder "FotoData" with properties {name:short date string of (current date) & " " & fotograaf & " " & stylist & " " & ("U" & unit)}
   make new folder at outputFolder with properties {name:fotograaf & " " & "Ready"}
   make new folder at outputFolder with properties {name:"Trash"}
end tell

-- Capture One 11
set sessionFolderPath to "/Users/Shared/"
set sessionName to {short date string of (current date) & " " & fotograaf & " " & stylist & " " & ("U" & unit)}

-- Create Session
tell application "Capture One 11"
   close every document without saving
   set newDoc to make new document with properties {name:sessionName, path:sessionFolderPath}
   
-- Set Output folder and Capture naming
   set capture name format of document 1 to "[Name]"
   set capture name of document 1 to {fotograaf & "," & stylist & ","}
   set output of document 1 to outputFolder as alias
   set capture done script to alias "Macintosh HD:Users:Shared:Scripts:Product.scpt"
end tell
Pat78
 
Posts: 25
Joined: Tue Sep 19, 2017 10:00 am

Re: Session Creator not 100% reliable

Postby Eric Nepean » Tue Sep 04, 2018 12:43 pm

Its possible that some user action have changed focus oand this cause references like "document 1" to point to the wrong document.

As a possible solution, instead of referring to "document 1" in these lines, refer to "newDoc"
Code: Select all
   set capture name format of document 1 to "[Name]"
   set capture name of document 1 to {fotograaf & "," & stylist & ","}
   set output of document 1 to outputFolder as alias
Cheers, Eric
[late 2015 iMac, 4GHz i7, 24GB RAM, external SSDs. GX8, E-M1, GX7, GM5, GM1 ....]
Eric Nepean
 
Posts: 402
Joined: Sat Oct 25, 2014 8:02 am

Re: Session Creator not 100% reliable

Postby Pat78 » Tue Sep 04, 2018 3:31 pm

This works Eric, thanks!
"document 1" was indeed pointing to the wrong document.
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