Copy link to clipboard
Copied
Is there a way to target the current artboard in Photoshop? I've read the Photoshop CC Scripting Reference but can't find anything about artboards. My current solution is:
var currentArtboard = doc.activeLayer.parent;
to target the artboard but this doesn't work if the layer is nested deeper.
I'm new to JavaScript and would appreciate help on how I can fix my script.
Object.prototype.slctArtbrd = function() {
while(!that || that.typename[0] != 'D')
that = (chld = (that || this)).parent
aD.activeLayer = aD.layers
.getByName(chld.name)
}
that = 0; (aD = activeDocument)
.activeLayer.slctArtbrd()
Copy link to clipboard
Copied
Object.prototype.slctArtbrd = function() {
while(!that || that.typename[0] != 'D')
that = (chld = (that || this)).parent
aD.activeLayer = aD.layers
.getByName(chld.name)
}
that = 0; (aD = activeDocument)
.activeLayer.slctArtbrd()
Copy link to clipboard
Copied
Thank you so much for your generous help, Kukurykus! It works! 😄
Find more inspiration, events, and resources on the new Adobe Community
Explore Now