Page 1 of 1

Session Creator not 100% reliable

PostPosted: Tue Sep 04, 2018 9:50 am
by Pat78
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

Re: Session Creator not 100% reliable

PostPosted: Tue Sep 04, 2018 12:43 pm
by Eric Nepean
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

Re: Session Creator not 100% reliable

PostPosted: Tue Sep 04, 2018 3:31 pm
by Pat78
This works Eric, thanks!
"document 1" was indeed pointing to the wrong document.