ScriptSpot

Forum topic · Scripts Wanted

copy all layer names to clipboard

By harumscarum · 2015-12-11

Description

would be very useful to have script which copy all layer names to clipboard
like this

ENV_buildings
ENV_curbs
ENV_details
ENV_furniture
ENV_grass
ENV_pavements
ENV_pools
ENV_roads
ENV_sand
ENV_sea
PLANT_shrubs
PLANT_trees

thanks in advance

Comments (10)

harumscarum · 2019-07-15

cool! thank you very much

same for selected ojects

harumscarum · 2019-07-14

could it be updated to copy to clipboard names of all selected objects, alphabetically

thanks

.

jahman · 2019-07-14

see if it works. I didn't test it in max


(
	names = for s in selection collect s.name
	qsort names stricmp
	ss = stringstream ""
	for n in names do format "%\n" n to:ss
	SetClipboardText ss
)

Eva Visnjic · 2016-03-18

Just what I needed. Thanks for the update.
Eva Visnjic

sort alphabetically

harumscarum · 2016-01-02

happy new year!
there is two little request if possible:
copy layers in alphabetical order
and add three spaces in the start of each row. like this:
   ENV_buildings
   ENV_curbs
   ENV_furniture

 

big thanks in advance
regards, viktor

barigazy · 2016-01-02


macroscript CopyToClipboardLayerList
category:"bga"
tooltip:"TOOLTIP NEEDED"
buttonText:"TEXT NEEDED"
(
fn copyToClipboardLayerList includeZero:off sorting:on =
(
e = if includeZero then 0 else 1
string = ""
if not sorting then
(
for i = e to layermanager.count-1 do string += (" " + (layermanager.getlayer i).name + "\n")
)
else
(
array = sort (for i = e to layermanager.count-1 collect (" " + (layermanager.getlayer i).name))
for str in array do string += (str + "\n")
)
setClipBoardText string
)

-- if argument "includeZero" is ON then Zero layer will be included in the string list or exclude zero layer with OFF (default is off)
copyToClipboardLayerList()
)

harumscarum · 2015-12-21

thank you very very much!

harumscarum · 2015-12-12

thank you very much. i tried to make it work as shortcut, didn't work for me. please hint me how to complete it

regards
viktor

.

miauu · 2015-12-12

This works for me:


macroscript CopyToClipboardLayerList
category:"bga"
tooltip:"TOOLTIP NEEDED"
buttonText:"TEXT NEEDED"
(
	fn copyToClipboardLayerList includeZero:off =
	(
		e = if includeZero then 0 else 1
		string = ""
		for i = e to layermanager.count-1 do string += ((layermanager.getlayer i).name + "\n")
		setClipBoardText string
	)
 
	-- if argument "includeZero" is ON then Zero layer will be included in the string list or exclude zero layer with OFF (default is off)
	copyToClipboardLayerList()
)

barigazy · 2015-12-11

This is the FN


fn copyToClipboardLayerList includeZero:off =
(
e = if includeZero then 0 else 1
string = ""
for i = e to layermanager.count-1 do string += ((layermanager.getlayer i).name + "\n")
setClipBoardText string
)

-- if argument "includeZero" is ON then Zero layer will be included in the string list or exclude zero layer with OFF (default is off)
copyToClipboardLayerList()