color editor options

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

color editor options

Postby NN110943UL » Sat Apr 25, 2020 6:39 am

Does anyone know where to find more info on how to set options and values for the color editor options. The script dictionary does not really give too much. Thanks
NN110943UL
 
Posts: 4
Joined: Tue Jun 09, 2009 5:36 pm

Re: color editor options

Postby Eric Nepean » Tue Apr 28, 2020 12:51 pm

I suggest that you down load a trial copy of Script Debugger.

Script Debugger has a really good dictionary feature, and a very handy Object Model Explorer, which allows you to observe all the properties of the and values of the Objects (catalog, variants, images) of Capture One while it is running.
Eric Nepean
 
Posts: 677
Joined: Sat Oct 25, 2014 8:02 am
Location: Ottawa

Re: color editor options

Postby rapdigital » Tue Apr 28, 2020 3:27 pm

Interestingly if you run the below in Scriptdebugger

Code: Select all
tell application "Capture One 12" to tell current document to set theVAR to variants whose selected is true


You get a list of all the properties for a selected image, what I dont understand is that the color editor settings array is always empty regardless of if the image has editor adjustments are not. So running the below will get you the brightness setting as you'd expect as part of a layer array or not (variables a & b). I cant return the editor settings array with any combo I can think of.

Code: Select all
tell application "Capture One 12" to tell current document
   set theVAR to variants whose selected is true
   set a to get brightness of adjustments of item 1 of theVAR
   set b to get brightness of adjustments of layer "Background" of item 1 of theVAR
   set c to get color editor settings of adjustments of layer "Background" of item 1 of theVAR
end tell


Strange or am I just missing something super obvious?
rapdigital
Certified Professional
Certified Professional
 
Posts: 190
Joined: Mon Feb 02, 2009 1:52 pm

Re: color editor options

Postby Eric Nepean » Tue Apr 28, 2020 5:58 pm

I am sure that color editor settings is a reference, but I'm having trouble learning what it refers to

Here is a quick script with some of my usual tricks to extract information. This didn't tell me anything except that it is a reference.
Code: Select all
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

tell application "Capture One 20" to tell current document
   set theVAR to variants whose selected is true
   set a to get brightness of adjustments of item 1 of theVAR
   set b to get brightness of adjustments of layer "Background" of item 1 of theVAR
   set d to get color editor settings of adjustments of layer "Background" of item 1 of theVAR
   set d2 to my isaref(d) -- returns TRUE
   set d1 to get properties of d -- returns {}
   try
      || of {d}
   on error ErrorMess
      log ErrorMess
      copy ErrorMess to d3
   end try
   ## returns Can’t get || of {color editor settings of adjustments of layer "Background" of variant id "5792" of collection id "682" of collection id "11" of collection id "10" of document "Incoming20" of application "Capture One 20"}
end tell

on isaref(objectToBeTested)
   ## Matt Nueberg
   try
      objectToBeTested as reference
      return true
   on error
      return false
   end try
end isaref

I suspect it is a reference to the following items:
    color balance master hue (real)
    color balance master saturation (real)
    color balance shadow hue (real)
    color balance shadow saturation (real)
    color balance shadow lightness (real)
    color balance midtone hue (real)
    color balance midtone saturation (real)
    color balance midtone lightness (real)
    color balance highlight hue (real)
    color balance highlight saturation (real)
    color balance highlight lightness (real)
Eric Nepean
 
Posts: 677
Joined: Sat Oct 25, 2014 8:02 am
Location: Ottawa

Re: color editor options

Postby rapdigital » Wed Apr 29, 2020 12:47 pm

I'm glad its nothing obvious then :shock:

I dont think its color balance because running the below does effect the 3-way color balance tool.

Code: Select all
   set color balance midtone hue of adjustments of item 1 of theVAR to 90


Having said all this I cant imagine how you could possibly set a color range selection, I'm guessing it would be require 16bit triplets and then the required calc to transform that to the desired colour would be pretty arduous.

I wonder if there's another way to achieve the result you are after?
rapdigital
Certified Professional
Certified Professional
 
Posts: 190
Joined: Mon Feb 02, 2009 1:52 pm

Re: color editor options

Postby Eric Nepean » Wed Apr 29, 2020 4:20 pm

rapdigital wrote:I'm glad its nothing obvious then :shock:

I dont think its color balance because running the below does effect the 3-way color balance tool.

Code: Select all
   set color balance midtone hue of adjustments of item 1 of theVAR to 90


Having said all this I cant imagine how you could possibly set a color range selection, I'm guessing it would be require 16bit triplets and then the required calc to transform that to the desired colour would be pretty arduous.

I wonder if there's another way to achieve the result you are after?

I think you may have hit the nail on the head. The color range parameters are very complex, and so C1 developers don't break them out to individual controls. All you get is a reference to them. You can this copy them from one variant to another,but you can't adjust the indifividual parameters. As a consequence II wonder if Applescript may not be able to save them.

This typically works for referenced value, but I did not get it to work here:
Code: Select all
get contents of someReference


This doesn't crash, but as best as I can tell, its still a reference tothe color editor settings of the variant
Code: Select all
set R1 to (get color editor settings of adjustments of layer "Background")
Eric Nepean
 
Posts: 677
Joined: Sat Oct 25, 2014 8:02 am
Location: Ottawa

Re: color editor options

Postby NN110943UL » Wed Apr 29, 2020 4:45 pm

Thanks all for your help. I'm new to AppleScripts, I downloaded Script Debugger and that has helped a lot. I have found a partial alternative solution, though I think that the color editor options would have been easier.
NN110943UL
 
Posts: 4
Joined: Tue Jun 09, 2009 5:36 pm


Return to Scripting



Who is online

Users browsing this forum: Google [Bot] and 3 guests