Copy link to clipboard
Copied
I found a partial bit of the script to rename artboards from a text layer however if you want to apply the script to multiple boards you have to do it one by one. My question is how would I alter this to make it cycle through all artboards?
if (activeDocument.activeLayer.parent.typename == "LayerSet")
activeDocument.activeLayer.parent.name = activeDocument.activeLayer.name;
Credit to r-bin
There might be some confusion because your code is renaming a LayerSet (group folder in the layers panel). Photoshop doesn't have artboards afaik, unlike Illustrator or InDesign.
But you can apply what the code is doing by iterating over an array (or collection) of ArtLayers in a for-loop. The wrinkle is Document.artLayers only gives top-level objects and doesn't check inside groups. So we'll need a helper function to recurse into those and find the layers. I've also added a conditional to check
...Copy link to clipboard
Copied
There might be some confusion because your code is renaming a LayerSet (group folder in the layers panel). Photoshop doesn't have artboards afaik, unlike Illustrator or InDesign.
But you can apply what the code is doing by iterating over an array (or collection) of ArtLayers in a for-loop. The wrinkle is Document.artLayers only gives top-level objects and doesn't check inside groups. So we'll need a helper function to recurse into those and find the layers. I've also added a conditional to check if a layer is text, since you mentioned that's a requirement.
Code attached as plain txt.
Copy link to clipboard
Copied
There might be some confusion because your code is renaming a LayerSet (group folder in the layers panel). Photoshop doesn't have artboards afaik, unlike Illustrator or InDesign.
By @Nick Combs
Hi Nick, thank you for contributing!
You are correct, in Photoshop's DOM, layerSet or layerSets are used to describe three separate layer types:
It takes the more esoteric AM code to differentiate between layer sets, artboards and frames.
Copy link to clipboard
Copied
Thanks Stephen. Always happy to learn something new!