Copy link to clipboard
Copied
Could someone please tell me why this function wont work....
I can set other properties like layer visibility using a putIndex but not color??
function layerColourIndex(index) {
function c2t(s) {return charIDToTypeID(s)}
var r1 = new ActionReference();
var d2 = new ActionDescriptor();
var d1 = new ActionDescriptor();
r1.putIndex(c2t('Lyr '), index)
d2.putEnumerated( c2t('Clr '), c2t('Clr '), c2t('None') );
d1.putReference( c2t('null'), r1 );
d1.putObject( c2t('T '), c2t('Lyr '), d2 );
executeAction( c2t('setd'), d1, DialogModes.NO );
};
Just checked again (CS6 and CC2020). Only the active layer changes.
Copy link to clipboard
Copied
layerColourIndex(1)
Copy link to clipboard
Copied
Copy link to clipboard
Copied
No, it works. Make document, duplicate layer few times, set all to some color, then select one which index is not in brackets of function caller. One's going to be uncoloured. Change number to confirm it.
The same for changing a name by index of unselected layer (that works too using Identifier with its id):
sTT = stringIDToTypeID;
(ref = new ActionReference()).putIndex(sTT('layer'), 1);
(dsc1 = new ActionDescriptor()).putReference(sTT('null'), ref);
(dsc2 = new ActionDescriptor()).putString(sTT('name'), 'Hello!')
dsc1.putObject(sTT('to'), sTT('layer'), dsc2)
executeAction(sTT('set'), dsc1)
Copy link to clipboard
Copied
Just checked again (CS6 and CC2020). Only the active layer changes.
Copy link to clipboard
Copied
Mine was updated few days ago to 22.4.0 and today again to 22.4.1
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I thought it does not work, as it never worked, fortunately thanks to this thread I found it finally works! Why can not you verify it while being ACP? Do you have some reasons for?
Copy link to clipboard
Copied
I thought it does not work, as it never worked, fortunately thanks to this thread I found it finally works!
By @Kukurykus
understood nothing : )
Why can't you verify it if you're ACP? Perhaps you don't want to use 2021 release for some reason.
By @Kukurykus
The new photoshop doesn't meet my system requirements. It just won't install.
Copy link to clipboard
Copied
That was my guess you may have too slow computer. Regarding first sentence I mean that I was aware we can't use in some cases Index to for ex. select a layer. Now I know it's changed.
Copy link to clipboard
Copied
Thank you both for your help, i didnt think of the version.
I can verify it works on machine with 22.4.0 release and not on machine with 20.0.1 release.
Havent updated as found new version very buggy.