Copy link to clipboard
Copied
Hello,
I found how to copy the layer name to clipboard, but I can't find how to paste it... !
Any ideas ? Thank you
Antoine
save selected layer name to Photoshop enviroment variables:
$.setenv ('layerName', activeDocument.activeLayer.name)
assign saved name to selected layer from enviroment variables:
activeDocument.activeLayer.name= $.getenv('layerName')
That is, you need to save both scripts to the photoshop presets/scripts folder. Record the first script call at the beginning of the first action - it will keep the current name. Record the second script at the end of the second action - it will restore it.
Copy link to clipboard
Copied
As a rule, the script does not need a clipboard. You can store the layer name in a variable and then assign it to another layer.
If you mean something else, please tell us more.
Copy link to clipboard
Copied
Thank you for your answer jazz-y
I'm doing some actions and I need to copy the layer name, play some actions (that change temporary the layer name) and at the end rename the layer with paste. So I was thinking to use one script to copy, and one to paste so I loose the name.
Did you have an easy idea ?
Copy link to clipboard
Copied
save selected layer name to Photoshop enviroment variables:
$.setenv ('layerName', activeDocument.activeLayer.name)
assign saved name to selected layer from enviroment variables:
activeDocument.activeLayer.name= $.getenv('layerName')
That is, you need to save both scripts to the photoshop presets/scripts folder. Record the first script call at the beginning of the first action - it will keep the current name. Record the second script at the end of the second action - it will restore it.
Copy link to clipboard
Copied
It works !! Thank you very much for your help.
Copy link to clipboard
Copied
app.document.paste() is a legal method, have you tried that?