Script for folder names of session
Hi,
i am trying to script a new session. Not really into applescript, just did some small ones like creating some kind of folders and subfolders.
Works fine, but i cannot get it to change the names of the subfolders capture or output.
Part of looks like this:
Tried with some phrases found, but nothing worked so far. Searched the whole forum without success. Perhaps someone can help me out?
Sven
i am trying to script a new session. Not really into applescript, just did some small ones like creating some kind of folders and subfolders.
Works fine, but i cannot get it to change the names of the subfolders capture or output.
Part of looks like this:
tell application "Capture One 10"
set newSession to make new document with properties {name:dasDatum & "_" & text returned of dialogInfo1 & "_P0" & dialogInfo2, path:sessionPath}Tried with some phrases found, but nothing worked so far. Searched the whole forum without success. Perhaps someone can help me out?
Sven
0
-
Rest of the code - perhaps helpful for someone: set d to current date
set derTag to text -2 thru -1 of ("0" & d's day)
set Monat to word 3 of ((current date) as text)
set MonatsListe to {January, February, March, April, May, June, July, August, September, October, November, December}
repeat with i from 1 to 12
if d's month = item i of MonatsListe then
set MM to text -2 thru -1 of ("0" & i)
exit repeat
end if
end repeat
set Jahr to ((year of d) as text)
set dasDatum to Jahr & "" & MM & "" & derTag
display dialog "Welcher Fotograf bist Du?" default answer "Dein Nachname"
copy the result to text_returned
set dialogInfo1 to result
set correctEntry to false
repeat while correctEntry is false
set textToDisplay to "In welchem Studio (1-11) arbeitest Du jetzt?"
display dialog textToDisplay default answer "1-11 / 7WW / 0 für Location"
set dialogInfo2 to text returned of the result
if dialogInfo2 = 0 then
set dilogInfo2 to "Location"
set correctEntry to true
end if
if dialogInfo2 = "7WW" then
set correctEntry to true
set dialogInfo2 to "7WW"
end if
if dialogInfo2 is not "7WW" then
try
set dialogInfo2 to dialogInfo2 as integer
set correctEntry to true
on error
try
set dialogInfo2 to dialogInfo2 as number
display dialog "Du hast keine ganze Zahl eingegeben."
on error
display dialog "Statt einer ganzen Zahl hast Du Text eingegeben."
end try
end try
if dialogInfo2 > 11 then
set correctEntry to false
end if
if dialogInfo2 > 11 then
display dialog "Bitte eine Zahl zwischen 1-11 eingeben."
end if
if dialogInfo2 < 0 then
set correctEntry to false
end if
if dialogInfo2 < 0 then
display dialog "Bitte eine Zahl zwischen 1-11 eingeben."
end if
end if
end repeat
tell application "Capture One 10" to run
activate
tell application "Capture One 10"
set defaultLocation to path to desktop
set sessionName to dasDatum
if dialogInfo2 = 0 then
tell application "Capture One 10"
set newSession to make new document with properties {name:dasDatum & "_" & text returned of dialogInfo1 & "_A", path:sessionPath}
end tell
end if
if dialogInfo2 is not 0 then
tell application "Capture One 10"
set newSession to make new document with properties {name:dasDatum & "_" & text returned of dialogInfo1 & "_P0" & dialogInfo2, path:sessionPath}
end tell
end if
tell application "Capture One 10" to run
activate
display dialog "Dein heutiger Produktionsordner wurde auf dem Schreibtisch angelegt." buttons {"OK"} default button "OK"
end tell
end0 -
The Capture One Document has the setable properties captures and output, which are the names (type text or file) used for Capture and Output.
I would start with a test script to show these proprerties:tell application "Capture One 12" to tell current document to set Var1 to {captures, output} of it
log Var1
The command "Choose folder" gives the folder name in to correct format.
so:
set theOutput to choose folder "select the Output Folder"
tell application "Capture One 12" to tell current document to set its captures to theOutput0 -
[quote="Eric Nepean" wrote:
The Capture One Document has the setable properties captures and output, which are the names (type text or file) used for Capture and Output.
I would start with a test script to show these proprerties:tell application "Capture One 12" to tell current document to set Var1 to {captures, output} of it
log Var1
The command "Choose folder" gives the folder name in the correct format.
so:
set theOutput to choose folder "select the Output Folder"
tell application "Capture One 12" to tell current document to set its captures to theOutput
It is a little confusing that the Applescript says that the properties are of type file or text.
When you do get the output property, it is of type file
But if you do convert the new folder reference to type file, as inset theOutput to (choose folder "select the Output Folder") as text,
then Capture One has an error if you try to set its output property to this.0
Post is closed for comments.
Comments
3 comments