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

Chat GPT

Participant ,
Feb 08, 2023 Feb 08, 2023

Copy link to clipboard

Copied

So someone was impressed with Chat GPT, so I asked if it can write scripts in JavaScript, sure enough it spit out this. Learning curve put aside for now 😊

08A43490-2182-442D-830A-F9D67E92F3E4.jpegexpand image

TOPICS
Actions and scripting

Views

7.7K

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 1 Correct answer

Community Expert , Feb 08, 2023 Feb 08, 2023
quote

I've been meaning to try that myself.

 

Does the script actually work in photoshop?

 

Did you have to specify that the script was for photoshop?


By Jeff Arola

 

Yes, it works:

 

var layer = app.activeDocument.artLayers.add();
layer.name = "Healing";
var groups = app.activeDocument.layerSets;
for (var i = 0; i < groups.length; i++) {
    if (groups[i].name === "Repair") {
        layer.move(groups[i], ElementPlacement.INSIDE);
        break;
    }
}

 

We have had a few people posting failed Ch

...

Votes

Translate

Translate
Adobe
Community Expert ,
Feb 08, 2023 Feb 08, 2023

Copy link to clipboard

Copied

I've been meaning to try that myself.

 

Does the script actually work in photoshop?

 

Did you have to specify that the script was for photoshop?

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 08, 2023 Feb 08, 2023

Copy link to clipboard

Copied

quote

I've been meaning to try that myself.

 

Does the script actually work in photoshop?

 

Did you have to specify that the script was for photoshop?


By Jeff Arola

 

Yes, it works:

 

var layer = app.activeDocument.artLayers.add();
layer.name = "Healing";
var groups = app.activeDocument.layerSets;
for (var i = 0; i < groups.length; i++) {
    if (groups[i].name === "Repair") {
        layer.move(groups[i], ElementPlacement.INSIDE);
        break;
    }
}

 

We have had a few people posting failed ChatGPT code here of late, this is the first one that I recall that actually works!

 

Of course, it would all depend on how the phrase/instructions are input and perhaps if there were multiple iterations to "tighten things up".

 

I too would have thought that the keywords of "Photoshop" or "ExtendScript" etc. would be required, however, the screenshot appears to show otherwise.

 

It is early days for such tools.

 

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
Participant ,
Feb 09, 2023 Feb 09, 2023

Copy link to clipboard

Copied

LATEST

Yes it works but if only one group with that name is in the layers palette, it doesn't if there is multiple groups, at least for me. Still nice how easy you can get what you're looking for, and with some refinement get it just right.

Edit: It works with more then one group, it just can't be nested inside another group 😊

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