New Filled Adjustment Layer - Easiest Way to Do This?
Is this the easiest way to create a new Filled Mask Adjustment Layer programmatically? (aside from hitting a keyboard shortcut)
Obviously, there is some extra code in there so I could name the layer how I want and number the layers, but wanted to see if anyone had figured out some options quicker than: 1. Get the variant. 2. Create new layer. 3. Set variable to the newly created layer's name. 4. Fill that layer's mask. Just feels roundabout.
tell application "Capture One 11"
set SelectedVariants to selected variants
repeat with a from 1 to count of SelectedVariants
set thisVariant to item a of SelectedVariants
set LayerNames to name of every layer of item 1 of thisVariant
set layerCount to count of LayerNames
set newLayerName to make new layer of thisVariant with properties {name:"Filled Layer " & layerCount}
set layerName to name of newLayerName
tell layer layerName of thisVariant
fill mask
end tell
end repeat
end tell
Obviously, there is some extra code in there so I could name the layer how I want and number the layers, but wanted to see if anyone had figured out some options quicker than: 1. Get the variant. 2. Create new layer. 3. Set variable to the newly created layer's name. 4. Fill that layer's mask. Just feels roundabout.
0
-
Hi Sean
Well you could certainly tighten up the code a bit.
If there was property of "layer" that included mask fill you could reduce the three "working" lines to two, but I don't see such a property.
tell application "Capture One 11"
repeat with thisVariant in (get selected variants)
set newLayerIndex to 1 + (count of every layer of thisVariant)
make new layer of thisVariant with properties {name:"Filled Layer " & newLayerIndex}
tell layer newLayerIndex of thisVariant to fill mask
end repeat
end tell
or even better
tell application "Capture One 11"
repeat with thisVariant in (get selected variants)
set newLayerIndex to 1 + (count of every layer of thisVariant)
set theNewLayer to make new layer of thisVariant with properties {name:"Filled Layer " & newLayerIndex}
tell theNewLayer to fill mask
end repeat
end tell0 -
Thanks for the code cleanup Eric! Great to see how these things can be tightened up, but at least I was correct in understanding that there wasn't a simpler line of code like you mention about a property of layer for mask fill. 0
Post ist für Kommentare geschlossen.
Kommentare
2 Kommentare