Copy link to clipboard
Copied
Hi,
I'm trying to figure out why i suddenly get this error when i run my script.
I verify, in VSCode that
activeDocument.layers.getByName("split_2")
[ArtLayer split_2]
But when i try to remove it:
activeDocument.layers.getByName("split_2").remove()
I get this:
I restarted PS, run the same script and the error is gone.
Is there anything i can do to try and understand what caused it to prevent this from happening again?
Thanks,
If "split_2" is a group, then you will get this error if no layers are selected.
EDITED:
It's been more than two years, I hope you've got the Answer.
If someone still loking for the answer
this error ocuures because some of your layers might be locked.
Unlock the layer and run the script again.
Hope it works.
Copy link to clipboard
Copied
If "split_2" is a group, then you will get this error if no layers are selected.
EDITED:
Copy link to clipboard
Copied
It's been more than two years, I hope you've got the Answer.
If someone still loking for the answer
this error ocuures because some of your layers might be locked.
Unlock the layer and run the script again.
Hope it works.
Copy link to clipboard
Copied
@amrsngh25 wrote:
It's been more than two years, I hope you've got the Answer.
If someone still loking for the answer
this error ocuures because some of your layers might be locked.
Unlock the layer and run the script again.
Hope it works.
Thank you for contributing!
To add even more value, could you post the appropriate code?
Copy link to clipboard
Copied
I just ran into this problem trying to export layers as png in Photoshop. It had never happened before. I had a hidden layer locked. Unlocking the layer resolved it. Thank you!
Copy link to clipboard
Copied
I get this error when the script tries to delete something that is outside of my image. The delete command was told to go to a coordinates Top: 2 inches, Left: 18 inches, Bottom: 2 inches and Right:20inches. My document was only 5 inchec wide and 5 inches tall. It won't "delete" something that is outside of my image. My image was too small. Hope that helps.
Copy link to clipboard
Copied
I get this error when the script tries to delete something that is outside of my image. The delete command was told to go to a coordinates Top: 2 inches, Left: 18 inches, Bottom: 2 inches and Right:20inches. My document was only 5 inchec wide and 5 inches tall. It won't "delete" something that is outside of my image. My image was too small. Check that your "delete" coordinates are within your image!.. Hope that helps.