How I can get last Index of gradient in list of gradients ?
I created .jsx file from action and have a line with text :
ref1.putIndex(cTID('Grdn'), 1);
but
ref1.putIndex(cTID('Grdn'), -1);
in
function step1(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putIndex(cTID('Grdn'), -1);
desc1.putReference(cTID('null'), ref1);
executeAction(sTID('delete'), desc1, dialogMode);
};
don't work for last gradients in list, I try to created action with 3 steps:
1)create new gradient
2)delete this gradient
3)delete last gradient -1
I converted this action in jsx file and try to run, but this script didn't work without edits.
If you have any ideas - thank you.