Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[Solved] Photoshop Scripting: Target current artboard

New Here ,
Jun 14, 2020 Jun 14, 2020

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.

 

 

TOPICS
Actions and scripting
985
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jun 14, 2020 Jun 14, 2020
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()
Translate
Adobe
LEGEND ,
Jun 14, 2020 Jun 14, 2020
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()
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 14, 2020 Jun 14, 2020
LATEST

Thank you so much for your generous help, Kukurykus!  It works! 😄

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines