Automatically search for specific layernames and execute action?
Hey!
Let's assume I have a document thet looks like this:
I want a script that does this [Pseudocode... Sortof]:
Set array = ["Template", "Product", "Canvas", "Document Version 1"];
loop trough layernames & groupnames based on array and set to active layer{
if(doc.activeLayer.name === "Template") Dothiscode1();
if(doc.activeLayer.name === "Product") Dothiscode2();
if(doc.activeLayer.name === "Canvas") Dothiscode3();
if(doc.activeLayer.name === "Document Version 1") Dothiscode4();
}
loop trough layernames & groupnames based on array{
if(layer "template" doesn't exists) { Dothisaction(); }
}
I've only just started scripting (like... an hour this friday, and another three hours today) with javascript, and the things I've tried so far either only find layers that's not within groups, or it only detects layers in groups.![]()
Please tell me if you need further information - do you want me to include code that I've tested so far?
[Moved out of the Coding Corner forum and into the more specific Photoshop Scripting forum - moderator]
