ScriptSpot home

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

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

Reply to br0t
yunusbbayram

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)

Reply to yunusbbayram
Panayot Karabakalov

you're almost there

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