I am writing a code in VBA to replace a text on a few layers in PSD file and so far I can open PSD, but I cannot select a layer by name. All that I found is that I should use PSDoc.ArtLayers.GetByName("Layer Name"), but that "GetByName" does not exists in VBA.
Then I tried looping through layers and then I found out there is no Layers.Length - that "Length" does not exists.
Basically I have group "Text" and layer "Layer 1". This is the closest I get, but this does not work:
PsDoc.ActiveLayer = PsDoc.ArtLayers.GetByName("Layer 1")
Does anyone knows how to select a layer by name using VBA (or VB)?
Reading your post made my head hurt....
Very usefull comment. VERY. Congratulations.
For Photoshop there's vbscript (VBS), not VB(A).
My question was about VBA, please read the full post, not just title, and I found the solution (last message in this thread).
My point is this forum is for as, vbs and js than python, c or vba, and I didn't miss your post 😉
Copy link to clipboard
Found it, by trials and errors:
PsApp.ActiveDocument.ActiveLayer = PsDoc.LayerSets.Item(1).Layers("Layer 1")