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

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

12.4K

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

People's Champ , 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.

Votes

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.

Votes

Translate

Translate
Adobe
People's Champ ,
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.

Votes

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.

Votes

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?

 

Votes

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

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!

Votes

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 ,
Nov 07, 2023 Nov 07, 2023

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.

Votes

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 ,
Nov 07, 2023 Nov 07, 2023

Copy link to clipboard

Copied

LATEST

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.

Votes

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