Creating a layer in a document using "constants" "LayerKind.COLORBALANCE" does not work

Dear all,
I have looked in the forum, but most use autobatch to create / adjust live a colorbalance layer. I just want to create a layer set with a certain value, for each iteration.
Using the same layer and adjust it was not yet planned, maybe I can find a way to do it in the future, but my question is about creating one.

I tried to create it using the COLORBALANCE version, but apparently I made a mistake.

let colorBalanceLayer = await document.createLayer(
constants.LayerKind.COLORBALANCE, // Create a color balance layer
{ name: “ColorBalanceRED_CYAN”, opacity: 100, blendMode: constants.BlendMode.NORMAL }
)
does not yield the expected result but instead triggered an error.

main.js:2973 Error: Unknown kind colorBalance somehow passed validation.

Hopefully I just made a trivial error.

Thank you for any tips on this matter!
Cheers,
Oliver

I have found a post that shows the kind of a layer as a number:

I have run into this issue a few times and typically I think this particular constant just hasn’t been implemented yet. I think there is a similar issue with blend modes, where only a few of the constants are actually implemented in the API even though they are all listed in the type defs. You may have to resort to batchplay or actions for now.

1 Like

Hi Josh,

thank you for your reply!
I will try to do the batch play (wanted to leave it out if I could, but apparently there are some things that just cannot be done ;D).

Cheers,
Oliver

1 Like