Create new session using template?

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

Create new session using template?

Postby SeanMurp » Thu Jul 27, 2017 3:21 pm

Anyone know if you can programmatically create a new session using a pre-made session template? There doesn't seem to be anything in the Capture One AppleScript dictionary that relates to this. It is not necessary for our workflow but would be a nice to have.

In case anyone wants/needs it, our current create new session code (session name and session path are pre-defined in a separate part of our script):
Code: Select all
tell application "Capture One 10"
               activate
               close every document without saving
               set newDoc to make new document with properties {name:sessionName, path:sessionFolderPath}
            end tell
SeanMurp
 
Posts: 52
Joined: Wed Nov 02, 2016 4:30 am

Re: Create new session using template?

Postby NNN635219644899555657 » Thu Apr 05, 2018 7:11 pm

Hi, Sean.

I lifted your code and made this:

Code: Select all
set sessionFolderPath to "Macintosh HD:Users:Br415a8:Desktop"
set sessionName to "Bobo"
tell application "Capture One 11"
   activate
   close every document without saving
   set newDoc to make new document with properties {name:sessionName, path:sessionFolderPath}
end tell


But I get this error. Not sure what to do?

error "Capture One 11 got an error: Cannot set because there is no file at this location." number -43
--
Bret
NNN635219644899555657
 
Posts: 10
Joined: Fri Dec 06, 2013 11:08 pm

Re: Create new session using template?

Postby SeanMurp » Thu Apr 05, 2018 8:53 pm

Hi Bret,
Should be a really easy fix to get it working. Use the POSIX path for the sessionFolderPath instead of the HFS path. So in this case it should be:
Code: Select all
set sessionFolderPath to "/Users/Br415a8/Desktop/"
set sessionName to "Bobo"
tell application "Capture One 11"
   activate
   close every document without saving
   set newDoc to make new document with properties {name:sessionName, path:sessionFolderPath}
end tell
SeanMurp
 
Posts: 52
Joined: Wed Nov 02, 2016 4:30 am

Re: Create new session using template?

Postby SeanMurp » Thu Apr 05, 2018 8:54 pm

We have also added in a System Events check to make sure the folder doesn't already exist. If it does exist then the user is prompted with a dialog asking if they want to replace or name differently.
SeanMurp
 
Posts: 52
Joined: Wed Nov 02, 2016 4:30 am

Re: Create new session using template?

Postby Jim_DK » Thu Apr 19, 2018 3:38 pm

You can now do this in 11.1 using pre-saved templates.
James
Phase One DK
Jim_DK
Crew
Crew
 
Posts: 630
Joined: Thu Dec 03, 2009 10:00 pm

Re: Create new session using template?

Postby SeanMurp » Thu Apr 19, 2018 4:21 pm

Great! Just updated and can't wait to give it a try.
SeanMurp
 
Posts: 52
Joined: Wed Nov 02, 2016 4:30 am


Return to Scripting



Who is online

Users browsing this forum: No registered users and 1 guest

cron