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

Linking Layers in Macro

New Here ,
May 12, 2021 May 12, 2021

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?

TOPICS
Actions and scripting

Views

2.1K

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

LEGEND , May 12, 2021 May 12, 2021

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())

Votes

Translate

Translate
LEGEND , May 12, 2021 May 12, 2021

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.

Votes

Translate

Translate
Adobe
LEGEND ,
May 12, 2021 May 12, 2021

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())

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 ,
May 12, 2021 May 12, 2021

Copy link to clipboard

Copied

I don't know how to implement this into my Recorded Action.

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
LEGEND ,
May 12, 2021 May 12, 2021

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.

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 ,
May 12, 2021 May 12, 2021

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

 

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 ,
May 12, 2021 May 12, 2021

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.

 

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
LEGEND ,
May 12, 2021 May 12, 2021

Copy link to clipboard

Copied

LATEST

After duplication of a layer, select original with a copy and link them. Original one gets unlinked.

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