cyanidemonkey Posted December 18, 2005 Share Posted December 18, 2005 Can anyone tell me why I can't write the file path information to an .ini file retrieved from the FileOpenDialog?When the test MsgBox pops up it shows the FileOpenDialog path ok.It writes to the .ini if i manually type the file path in.I've tried adding focus to the text field, and wrapping the FileOpenDialog() in a String() to make sure it's a string but it diddn't work.$var = "" $btn2 = GUICtrlCreateButton("find file", 470, 300, 120) GUICtrlSetOnEvent($btn2, "FindFile") Func FindFile() $var = FileOpenDialog("Choose file...","C:","All (*.*)", 1 + 2) GUICtrlSetState($DFpath, $GUI_FOCUS) GUICtrlSetData($DFpath,$var) ;testing message MsgBox(0, "wot tha...?","$var = " & $var) IniWrite("settings.ini","config","DFpath", $var) EndFunc My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator Link to comment Share on other sites More sharing options...
GaryFrost Posted December 18, 2005 Share Posted December 18, 2005 try IniWrite(@ScriptDir & "\settings.ini", "config", "DFpath", $var) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Valuater Posted December 18, 2005 Share Posted December 18, 2005 this works #include "GUIConstants.au3" Opt("GUIOnEventMode", 1) ;0=disabled, 1=OnEvent mode enabled GUICreate("MY GUI") $var = "" $btn2 = GUICtrlCreateButton("find file", 100, 230, 120) GUICtrlSetOnEvent($btn2, "FindFile") $btn3 = GUICtrlCreateButton("find ini", 100, 330, 120) GUICtrlSetOnEvent($btn3, "Findini") GUISetState() while 1 sleep(20) wend Func FindFile() $var = FileOpenDialog("Choose file...","C:","All (*.*)", 1 + 2) ;GUICtrlSetState($DFpath, $GUI_FOCUS) ;GUICtrlSetData($DFpath,$var) ;testing message MsgBox(0, "wot tha...?","$var = " & $var) IniWrite(@ScriptDir & "\settings.ini","config","DFpath", $var) EndFunc Func Findini() MsgBox(0,"test read", (iniread(@ScriptDir & "\settings.ini","config","DFpath", "not found"))) EndFunc 8) Link to comment Share on other sites More sharing options...
cyanidemonkey Posted December 18, 2005 Author Share Posted December 18, 2005 Thank you very much guys My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator Link to comment Share on other sites More sharing options...
Valuater Posted December 18, 2005 Share Posted December 18, 2005 Thank you very much guys welcome...but frosty got there first... Dah8) Link to comment Share on other sites More sharing options...
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