copy all layer names to clipboard

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
harumscarum's picture

cool! thank you very much

cool! thank you very much

harumscarum's picture

same for selected ojects

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

thanks

jahman's picture

.

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's picture

Just what I needed. Thanks

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

harumscarum's picture

sort alphabetically

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's picture

...

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

bga

harumscarum's picture

thank you very very much!

thank you very very much!

harumscarum's picture

thank you very much. i tried

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's picture

.

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's picture

...

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

bga

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.