Process Scripting Error (Newbie..)
I'm just starting to play with scripting, so forgive my ignorance here. This is the first script I wrote, it works, but an error message pops up regardless.
The error I get is
tell application "Capture One 12"
process primary variant
recipe "JPEG sRGB"
end tellThe error I get is
Capture One 12 got an error: Error -1728 occurred: Can’t get recipe "JPEG sRGB".
0
-
when you see that little almost invisible "¬" symbol at the end of a line, that's the line continution symbol, the next line is part of this line. You create it by clicking "option"-enter.
what written in the dictionary is this:
process primary variant¬
recipe "JPEG sRGB"
## which is the same as
process primary variant recipe "JPEG sRGB"
whereas your script told Capture One to execute the recipe command, and it responded "Huh???"
(I think I've just told you that you're one character short of a full script 😄 )0 -
Thanks Eric!
Question though, I just looked back at the dictionary and I don't see that little symbol. Where are you seeing that?0 -
Interesting.
I see it in the dictionary when using Script Debugger
I do not see it in the Dictionary when using Script Editor
As most people use Script Editor, It was not there for you to see.0 -
I'll have a look at that software, wasn't familiar with it.
Also, when using properties for recipes, are they supposed to override the selected/enabled recipe?
I've been trying to adjust the properties of a recipe, I don't get any errors, but I regardless of the property value, I only get the properties of the recipe settings in capture one.
So the recipe "JPEG sRGB" in capture one is set to output a 100ppi image, so I'm trying to alter that property to output a 300ppi image, but with the code below, I still get a 100ppi image.tell application "Capture One 12"
process primary variant recipe "JPEG sRGB"
set enable to true
set outputformat to JPEG_QuickProof
set pixelsperinch to 300
end tell0 -
[quote="james471" wrote:
I'll have a look at that software, wasn't familiar with it.
Also, when using properties for recipes, are they supposed to override the selected/enabled recipe?
I've been trying to adjust the properties of a recipe, I don't get any errors, but I regardless of the property value, I only get the properties of the recipe settings in capture one.
So the recipe "JPEG sRGB" in capture one is set to output a 100ppi image, so I'm trying to alter that property to output a 300ppi image, but with the code below, I still get a 100ppi image.tell application "Capture One 12"
process primary variant recipe "JPEG sRGB"
set enable to true
set outputformat to JPEG_QuickProof
set pixelsperinch to 300
end tell
You're telling the application, which doesn't understand the enable, output format, or pixelsperinch properties and instead thinks they're variables. Also, your process command is coming before the alterations- it will result in a processed file, then the changes. Reverse it.0 -
okay, so help me understand how to do this properly then. After thinking this through a bit more, and seeing how other scripts work with C1, here's what I feel the script needs to do...in this order..so correct me if I'm wrong.
Tell Capture One 12 to:
select a single variant or multiple variants within the current document
set the parameters for processing
output format to jpeg_quickproof
pixels per inch to 300
root folder type to output location
tell capture to process the variant
Is that some what correct?0 -
[quote="james471" wrote:
okay, so help me understand how to do this properly then. After thinking this through a bit more, and seeing how other scripts work with C1, here's what I feel the script needs to do...in this order..so correct me if I'm wrong.
Tell Capture One 12 to:
select a single variant or multiple variants within the current document
set the parameters for processing
output format to jpeg_quickproof
pixels per inch to 300
root folder type to output location
tell capture to process the variant
Is that some what correct?
Close but missing a few details (understandable for newbie - I was there once at least)
First, there is little point in asking Capture One to select variants. How do you tell it which variants to select?
The thinking goes the other way - you (as the user) select variants to tell Capture One which variants you want it to process, and then you run your script. Capture One shall know ye by the variants ye select 😂
The script then uses this command:Now the variable theVariants contains references to the variants you (the user) have selected and you (the coder) use this in your script.
tell application "Capture One 12" to set theVariants to (get selected variants)
Next, it always key to understand the object hierarchy (tree)- what kind of objects does each object contain
- What are the properties of each object
Application "Capture One 12"
.....contains:- variants
- images
- windows
- documents
.....contain- variants
- images
- recipes
- collections
.....contain- variants
- images
- collections
.....contain- .....
The following items are a property of a recipe (along with many other properties):- output format
pixels per inch
root folder typeMake sure you open Script Editor's log history window and click on messages (to see the logging) and replies (to see what caopture one is actually sending)
tell application "Capture One 12"
log {"All the document names:", (get every document's name)}
log return
set docRef to current document
tell current document
set docName to its name
set docKind to (get its kind as text)
set docRef to it -- same as previous line
set recipeRef to its first recipe
log "Document is " & docKind & " " & docName
log return
log "These are " & docName & "'s recipes"
log (get its recipes)
log return
log "These are the names of " & docName & "'s recipes"
log (get name of its recipes)
log return
log "These are the pixels per inch of " & docName & "'s recipes"
log (get pixels per inch of its recipes)
log return
log "These are the properties of " & docName & "'s first recipe"
log (get properties of first recipe)
end tell
end tell
tell application "Capture One 12" to tell docRef to get pixels per inch of its first recipe
tell application "Capture One 12" to get recipeRef's pixels per inch0 -
Thank you Eric, this is some good starting grounds. Now I just need to find the time to learn!! 0 -
[quote="james471" wrote:
Thank you Eric, this is some good starting grounds. Now I just need to find the time to learn!!
I have come to understand how diffficult this is for newbies. I got a few minutes and made something that works.
tell application "Capture One 12"
set recipeName to "JPEG sRGB"
set primaryVariantOnly to false
tell current document's recipe recipeName
set enabled to true
set output format to JPEG_QuickProof
set pixels per inch to 300
end tell
if primaryVariantOnly then
process primary variant recipe "JPEG sRGB"
else
set theVariantList to selected variants
repeat with theProcessVariant in theVariantList
process (contents of theProcessVariant) recipe "JPEG sRGB"
end repeat
end if
end tell0 -
Oh this is awesome, going to try it out tomorrow...really appreciate it. It also really helps me understand things by seeing a visual. I'm very good about breaking things down, not so good at starting from scratch. 0
Post is closed for comments.
Comments
10 comments