Getting/setting all linked layers in a document

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

d3mac123

Getting/setting all linked layers in a document

Post by d3mac123 »

I have a "weird" script that needs to auto select and link a few layers. After its use, it cleans up all the linked layers used. It works perfectly if no layers were linked before. However, for example, if layer A is linked to layer B before the script runs, the link is gone after the script executes.

I am wondering if there is a way to capture and probably save in a table, a list with ALL linked layers (for example, layer A is linked with B, layer C is linked with D and E, etc). Then, after my script runs/clean up everything, another function is called just to set all the links again.

Ideas?

Alex

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Mike Hale

Getting/setting all linked layers in a document

Post by Mike Hale »

A layer object has a linkedLayers property that will return an array of linked layers it the layer has any.

You could build you table using that property and looping all the layers.