Export visible layer names to CSV

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

havocki
Posts: 1
Joined: Tue Sep 06, 2022 6:28 pm

Export visible layer names to CSV

Post by havocki »

Hello. I need help with one script > Export list in one row of visible layers only but without duplicates and no folder names and no artboards names, only a list of visible layers. I tried to find the differen script, but unfortunately nothing works for me. Once I have everything in column, another time I have row but also all duplicates...
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: Export visible layer names to CSV

Post by Kukurykus »

How you specify what is duplicate, by a 'copy' in name?

Code: Select all

lrs = []; (function prcssArtLrs(v) {
    for(i = (aLs = v.artLayers).length -1; 0 <= i; i--)
		(lyr = aLs[i]).visible && lyr.name.indexOf('copy') < 0
		&& lrs.push(aLs[i].name); for(i = (lSs = v.layerSets)
		.length -1; 0 <= i; i--) prcssArtLrs(lSs[i])
})(activeDocument)

with(File(File($.fileName).path + '/.csv')) open('w'), write(lrs), close()