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

Custom UI dialog - Photoshop Error 21: Undefined is not an object [2020]

Engaged ,
May 04, 2020 May 04, 2020

The UI  dialog allows the user to create a new layer group with a custom name or with the default Group name. When the script creates the new layer group the error 21:  undefined is not an object alert display.  The error displays when using a custom name or default name in the Photoshop desktop app. The error 21 is not visible when testing in the Visual Code text editor. Only visible in the Photoshop CC 2019 app. The error 21 happens on line 385 in the addLayerSet() function.

Any suggestions to troubleshoot this error 21?

 

The UI code logic: 

New layer group variable = eddittext1

Function addLayerSet()

Local variable=  "Group"

Conditional if local variable = eddittext1

make a generic layer group

else make custom layer group

 

Screen Shot 2020-05-04 at 3.10.04 PM.png

 

Screen Shot 2020-05-04 at 3.12.12 PM.png

 

Screen Shot 2020-05-04 at 4.26.34 PM.png

 
TOPICS
Actions and scripting
2.7K
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

People's Champ , May 05, 2020 May 05, 2020
Need to see all the code. Especially those places where you call the addLayerSet() function and what you pass to it as an argument.
 
Translate
Adobe
Mentor ,
May 04, 2020 May 04, 2020

When you close script window - before or after running this function?

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
Engaged ,
May 04, 2020 May 04, 2020

I try placing the dialog.close() in two places. Before running the functions and after running the functions. The same error 21: Undefined is not an object that comes up in both places.

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
People's Champ ,
May 05, 2020 May 05, 2020
Need to see all the code. Especially those places where you call the addLayerSet() function and what you pass to it as an argument.
 
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
Engaged ,
May 05, 2020 May 05, 2020
LATEST

Thanks for your help. I was able to follow up on your suggestion and found an error with a function call.

The main() function was called at two places in the script. I disabled the main() function call and the error 21 dematerialized.  Thanks again!

 

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