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

Command "Delete" is not currently available

Engaged ,
Aug 11, 2019 Aug 11, 2019

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,

TOPICS
Actions and scripting

Views

9.2K

Likes

Translate

Translate

Report

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 2 Correct answers

Valorous Hero , Aug 11, 2019 Aug 11, 2019

If "split_2" is a group, then you will get this error if no layers are selected.

EDITED:

This happens if no layers are selected and the topmost layer is "split_2"

When you reopen the file, the active layer is automatically reselected and the error disappears.

Likes

Translate

Translate
New Here , Feb 03, 2022 Feb 03, 2022

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.

Likes

Translate

Translate
Valorous Hero ,
Aug 11, 2019 Aug 11, 2019

Copy link to clipboard

Copied

If "split_2" is a group, then you will get this error if no layers are selected.

EDITED:

This happens if no layers are selected and the topmost layer is "split_2"

When you reopen the file, the active layer is automatically reselected and the error disappears.

Likes

Translate

Translate

Report

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 ,
Feb 03, 2022 Feb 03, 2022

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.

Likes

Translate

Translate

Report

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
Community Expert ,
Feb 03, 2022 Feb 03, 2022

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?

 

Likes

Translate

Translate

Report

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 ,
Oct 12, 2022 Oct 12, 2022

Copy link to clipboard

Copied

LATEST

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!

Likes

Translate

Translate

Report

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