aphesia Posted May 24, 2011 Posted May 24, 2011 Hi, i would like to get a dialog prompt to choose files / folders and then save the path of the chosen stuff into some .ini file. Not sure how to safe the path of the select files aswell as how to choose folders with that dialog (right now i can only open folders) thanks
Moderators Melba23 Posted May 24, 2011 Moderators Posted May 24, 2011 aphesia,For files use FileOpenDialog.For folders use FileSelectFolder.Save the function return in a variable and then use IniWrite to put it into an ini file.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
sleepydvdr Posted May 24, 2011 Posted May 24, 2011 (edited) FileOpenDialog and FileSelectFolder will do the trick. Edit: Melba23 is faster than me. Edited May 24, 2011 by sleepydvdr #include <ByteMe.au3>
aphesia Posted May 24, 2011 Author Posted May 24, 2011 (edited) aphesia, For files use FileOpenDialog. For folders use FileSelectFolder. Save the function return in a variable and then use IniWrite to put it into an ini file. M23 Thanks.. fileselectfolder was exactly what i was looking for (well a dialog for files & folder at the same time would be even better but its fine ) however, when doing multi-selects, the ini looks like this: test1=C:\Users\Patrick\Documents\AutoIt|script.au3|Settings.ini but i would need it like this: test1=C:\Users\Patrick\Documents\AutoIt\script.au3 test2=C:\Users\Patrick\Documents\AutoIt\Settings.ini @edit: on top of that i would need every line from the ini to be written into an editbox but when deleting a line or editing a line inside the editbox, it should also change inside the ini. I guess i need to use an array here? Edited May 24, 2011 by aphesia
Developers Jos Posted May 24, 2011 Developers Posted May 24, 2011 but i would need it like this: test1=C:\Users\Patrick\Documents\AutoIt\script.au3 test2=C:\Users\Patrick\Documents\AutoIt\Settings.ini @edit: on top of that i would need every line from the ini to be written into an editbox but when deleting on line or editing a line inside the editbox, it should also change inside the ini. I guess i need to use an array here? Ok, so you expect it all to be coded for you or did you need help with what you already have tried? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Moderators Melba23 Posted May 24, 2011 Moderators Posted May 24, 2011 (edited) aphesia,Look at StringSplit - then you can separate the various parts of the returned string and then concatenate them when writing the ini file. a dialog for files & folder at the same time would be even better but its fine )You could use my ChooseFileFolder UDF to do both things with the same dialog. M23Edit: Typnig! Edited May 24, 2011 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
monoscout999 Posted May 24, 2011 Posted May 24, 2011 I wrote this... but i think is useless now :\ $var = FileOpenDialog($message, @WindowsDir & "\", "Images (*.jpg;*.bmp)", 1 + 4 ) If @error Then MsgBox(4096,"","No File(s) chosen") Else $OnlyFileName = StringSplit($var,"\") $OnlyFolder = StringTrimRight($var,StringLen($OnlyFileName[ubound($OnlyFileName)-1])) MsgBox(4096,"","You chose " & $OnlyFileName[ubound($OnlyFileName)-1]) MsgBox(4096,"","You chose " & $OnlyFolder) EndIf sorry i arrive later...
aphesia Posted May 25, 2011 Author Posted May 25, 2011 (edited) @Jobs: no not really i was just looking for Stringsplit and other commands which i didnt know/couldnt find.. and propably an idea on how to do that stuff with the editbox & the line-by-line read/write from an .ini @melba23: thanks alot.. stringsplit seems to be exactly what i was looking for.. will try it out as soon as i come home from work also that udf sounds great ! @monoscout: np still you helped me out cause i didnt knew how to use multiple options (e.g. 1 and 4) in the fileopendialog.. but you just showed me how to ;D $var = FileOpenDialog($message, @WindowsDir & "\", "Images (*.jpg;*.bmp)", 1 + 4 ) Edited May 25, 2011 by aphesia
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