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 😊
1 Correct answer
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
...Explore related tutorials & articles
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?
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?
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.
Copy link to clipboard
Copied
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 😊

