dropdownlist items(getdir....) error

rollout test "" 
 ( 	
dropDownList ddl1 "Languages" pos:[14,9] width:123 height:10  	
label asd "asdfg" button li "dsd" 	 	 	 	
on li pressed do
( 	
 ddl1.items=(for f in getdir (#maxRoot +"\\test\\*.*") collect getFilenameFile f ) 
		) 	
 )  createdialog test

How do I  lists the files in the test folder ?

Comments

Comment viewing options

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

mhm try this: rollout test

mhm try this:

rollout test "" 
( 	
	dropDownList ddl1 "Languages" pos:[14,9] width:123 height:10  	
	label asd "asdfg" button li "dsd" 	 	 	 	
	on li pressed do
	( 	
		 ddl1.items = getFiles (getDir #maxRoot + "\\*.*")
	)--end on
)--end ro
createdialog test

Theres also a sample script on how to loop through all subfolders and get their files as well in the help files ("External File Methods")

Cheers

Never get low & slow & out of ideas

yunusbbayram's picture

thank you running this

thank you running this script. but it looks like this dropdownlist =>

E:\kurulum\Autodesk\3ds max 2012 64\3ds Max 2012\3dsmax.exe
E:\kurulum\Autodesk\3ds max 2012 64\3ds Max 2012\3dsmaxcmd.exe
....................
....................ect.

but I want to look like that. => 3dsmax.exe (only filename)

Anubis's picture

you're almost there

files = GetFiles (GetDir #maxRoot + "/*.*")
ddl1.items = for f in files collect getFilenameFile f

my recent MAXScripts RSS (archive here)

yunusbbayram's picture

thank you very much Anubis,

thank you very much Anubis, br0t

Comment viewing options

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