ScriptSpot

Forum topic · General Scripting

dropdownlist items(getdir....) error

By yunusbbayram · 2011-05-30

Description

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

mhm try this: rollout test

br0t · 2011-05-30

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

yunusbbayram · 2011-05-30

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)

you're almost there

Anubis · 2011-05-31

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

yunusbbayram · 2011-05-31

thank you very much Anubis, br0t