Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
When you close script window - before or after running this function?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now