Madza91 Posted October 19, 2007 Posted October 19, 2007 Hi everybody, is possible to get files from folder and make "GUICtrlCreateMenuItem" with that files?. example: if in languages folder have english.ini and spanish.ini -> to make GUICtrlCreateMenuItem spanish and engish,how? [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
PsaltyDS Posted October 19, 2007 Posted October 19, 2007 Hi everybody, is possible to get files from folder and make "GUICtrlCreateMenuItem" with that files?. example: if in languages folder have english.ini and spanish.ini -> to make GUICtrlCreateMenuItem spanish and engish,how? _FileListToArray() Then loop through the array doing whatever you want with the names. In this case StringReplace($avFile[$n], ".ini", "") would take out the extension, then you could use the filename for your menu item. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Madza91 Posted October 19, 2007 Author Posted October 19, 2007 Like this: #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray(@DesktopDir) If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf _ArrayDisplay($FileList,"$FileList") But if i make this for iniwrite not work :/ #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray(@DesktopDir) If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf _ArrayDisplay($FileList,"$FileList") IniWrite("asd.ini","asd","asd",$FileList) Why not work? [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
PsaltyDS Posted October 19, 2007 Posted October 19, 2007 You need to loop through the contents of the array. The first element [0] contains the count, and [1] thru [n] contain the file names (as you should see from the _ArrayDisplay you have): For $n = 1 To $FileList[0] IniWrite("asd.ini", "asd", "asd", $FileList[$n]) Next Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Bert Posted October 19, 2007 Posted October 19, 2007 look at this:http://www.autoitscript.com/forum/index.ph...l=dynamic++menu The Vollatran project My blog: http://www.vollysinterestingshit.com/
Madza91 Posted October 19, 2007 Author Posted October 19, 2007 Tnx, i maded this [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now