Copy link to clipboard
Copied
I'm tryiong to create a macro that will duplicate the selected layer and then link the copy and original together. It's working fine, unless the original layer is already linked to another. In such a case it unlinks the original layer.
Anyone know why the "Link Selected Layers" command is unlinking, or have a work-around for this?
If the layer was already linked with others, it is going to prevent from unlinking it (while linking with its copy):
(aL = (aD = activeDocument).activeLayer).link(aL.duplicate())
Save it in a file with any name that have .jsx extension. Then you can either move it to Presets / Actions of your Ps folder to Insert Menu Item from File / Scripts in (restarted) Ps or keep in other place to choose .jsx file from disk by File / Scripts menu item when recording an action.
Copy link to clipboard
Copied
If the layer was already linked with others, it is going to prevent from unlinking it (while linking with its copy):
(aL = (aD = activeDocument).activeLayer).link(aL.duplicate())
Copy link to clipboard
Copied
I don't know how to implement this into my Recorded Action.
Copy link to clipboard
Copied
Save it in a file with any name that have .jsx extension. Then you can either move it to Presets / Actions of your Ps folder to Insert Menu Item from File / Scripts in (restarted) Ps or keep in other place to choose .jsx file from disk by File / Scripts menu item when recording an action.
Copy link to clipboard
Copied
More info on saving and installing/running scripts here:
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html
Copy link to clipboard
Copied
What's wrong with the layer > duplicate layer command?
I tested with 2 layers linked together. Then selected the top layer and duplicated. The result was that all three layers were linked, the original link between the 2 layers was not lost.
Copy link to clipboard
Copied
After duplication of a layer, select original with a copy and link them. Original one gets unlinked.