tobi2006 Posted May 15, 2007 Share Posted May 15, 2007 How can I save the text, that I typed in the editbox, as a txt file? Link to comment Share on other sites More sharing options...
November Posted May 15, 2007 Share Posted May 15, 2007 How can I save the text, that I typed in the editbox, as a txt file? Hi,See in help file about:GUICtrlReadFileWrite or FileWriteLine Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
James Posted May 15, 2007 Share Posted May 15, 2007 #include <GUIConstants.au3> $sGui = GUICreate("FileWrite Text", 634, 450, -1, -1) $Edit = GUICtrlCreateEdit("", 0, 0, 633, 401, BitOR($ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, "TYPE IN HERE THEN PRESS SAVE. I WILL SAVE TO C:\test.txt!") $Save = GUICtrlCreateButton("Save", 208, 408, 177, 41, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Save $Txt = GuiCtrlRead($Edit) FileWrite("C:\test.txt", $Txt) EndSwitch WEnd See you, James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
November Posted May 15, 2007 Share Posted May 15, 2007 #include <GUIConstants.au3> $sGui = GUICreate("FileWrite Text", 634, 450, -1, -1) $Edit = GUICtrlCreateEdit("", 0, 0, 633, 401, BitOR($ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, "TYPE IN HERE THEN PRESS SAVE. I WILL SAVE TO C:\test.txt!") $Save = GUICtrlCreateButton("Save", 208, 408, 177, 41, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Save $Txt = GuiCtrlRead($Edit) FileWrite("C:\test.txt", $Txt) EndSwitch WEnd See you, James hey Secure_ICT, Let them do some research hehehehe nice example as usual! Cheers m8 Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
tobi2006 Posted May 15, 2007 Author Share Posted May 15, 2007 Hi,See in help file about:GUICtrlReadFileWrite or FileWriteLine Cheers But then it saves Line 1, Line 2, ... in a txt file and not the text I typed in the editbox! Link to comment Share on other sites More sharing options...
James Posted May 15, 2007 Share Posted May 15, 2007 November, agreed I should let them. But I am being helpful. Thanks for the comment! Tobi, there is an example above ^^ Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
November Posted May 15, 2007 Share Posted May 15, 2007 But then it saves Line 1, Line 2, ... in a txt file and not the text I typed in the editbox!Hi m8,use this :FileOpen ( "filename", mode )1 = Write mode (append to end of file)Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
tobi2006 Posted May 15, 2007 Author Share Posted May 15, 2007 #include <GUIConstants.au3> $sGui = GUICreate("FileWrite Text", 634, 450, -1, -1) $Edit = GUICtrlCreateEdit("", 0, 0, 633, 401, BitOR($ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, "TYPE IN HERE THEN PRESS SAVE. I WILL SAVE TO C:\test.txt!") $Save = GUICtrlCreateButton("Save", 208, 408, 177, 41, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Save $Txt = GuiCtrlRead($Edit) FileWrite("C:\test.txt", $Txt) EndSwitch WEnd See you, James I want to give the txt file a name! How? Link to comment Share on other sites More sharing options...
James Posted May 15, 2007 Share Posted May 15, 2007 Replace the C:\text.txt with the name that you want to give it. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
November Posted May 15, 2007 Share Posted May 15, 2007 Replace the C:\text.txt with the name that you want to give it.HeheheOr :$filetochange = "c:\test.txt"FileWrite($filetochange, $Txt)Just give a bigger idea of what can be done!Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
James Posted May 15, 2007 Share Posted May 15, 2007 Yeah, basically what November said allows you to define it somewhere for easier usage. And if you have a big script. So adding his bit, the example would be. #include <GUIConstants.au3> $filename = "C:\FILENAME.txt" ; Change the location and name of the file here $sGui = GUICreate("FileWrite Text", 634, 450, -1, -1) $Edit = GUICtrlCreateEdit("", 0, 0, 633, 401, BitOR($ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, "TYPE IN HERE THEN PRESS SAVE. I WILL SAVE TO C:\test.txt!") $Save = GUICtrlCreateButton("Save", 208, 408, 177, 41, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Save $Txt = GuiCtrlRead($Edit) FileWrite($filename, $Txt) EndSwitch WEnd There you go. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
tobi2006 Posted May 15, 2007 Author Share Posted May 15, 2007 Yeah, basically what November said allows you to define it somewhere for easier usage. And if you have a big script. So adding his bit, the example would be. #include <GUIConstants.au3> $filename = "C:\FILENAME.txt" ; Change the location and name of the file here $sGui = GUICreate("FileWrite Text", 634, 450, -1, -1) $Edit = GUICtrlCreateEdit("", 0, 0, 633, 401, BitOR($ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, "TYPE IN HERE THEN PRESS SAVE. I WILL SAVE TO C:\test.txt!") $Save = GUICtrlCreateButton("Save", 208, 408, 177, 41, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Save $Txt = GuiCtrlRead($Edit) FileWrite($filename, $Txt) EndSwitch WEnd There you go. I want to use the FileSaveDialog to chose the name for the txt file. Link to comment Share on other sites More sharing options...
James Posted May 15, 2007 Share Posted May 15, 2007 (edited) Well why dont you use the HelpFile? If you cant find anything then ask. By the way, I have done it. So if you cant find anything or get it to work. Then ask. It is very simple, just a case of FileSaveDialog and Changing the FileWrite to what the FileSaveDialog is called. Edited May 15, 2007 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
November Posted May 15, 2007 Share Posted May 15, 2007 Hi, Using Secure_ICT code: #include <GUIConstants.au3> $sGui = GUICreate("FileWrite Text", 634, 450, -1, -1) $Edit = GUICtrlCreateEdit("", 0, 0, 633, 401, BitOR($ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, "TYPE IN HERE THEN PRESS SAVE. I WILL SAVE TO C:\test.txt!") $Save = GUICtrlCreateButton("Save", 208, 408, 177, 41, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Save $savedialog = FileSaveDialog("Select file to write", "", "*.txt");Selects txt file to write $Txt = GuiCtrlRead($Edit) FileWrite($savedialog, $Txt) EndSwitch WEnd Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
James Posted May 15, 2007 Share Posted May 15, 2007 November.. Give him a chance to research! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
November Posted May 15, 2007 Share Posted May 15, 2007 November.. Give him a chance to research!LOLMy bad... CODE REMOVED LOOOOLLLOOOOLI think i carried away the help Bad November Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] Link to comment Share on other sites More sharing options...
James Posted May 15, 2007 Share Posted May 15, 2007 Bad boy *he needs an ass whipping* KAT!!!! tobi, have you done it yet? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
tobi2006 Posted May 15, 2007 Author Share Posted May 15, 2007 Hi, Using Secure_ICT code: #include <GUIConstants.au3> $sGui = GUICreate("FileWrite Text", 634, 450, -1, -1) $Edit = GUICtrlCreateEdit("", 0, 0, 633, 401, BitOR($ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, "TYPE IN HERE THEN PRESS SAVE. I WILL SAVE TO C:\test.txt!") $Save = GUICtrlCreateButton("Save", 208, 408, 177, 41, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Save $savedialog = FileSaveDialog("Select file to write", "", "*.txt");Selects txt file to write $Txt = GuiCtrlRead($Edit) FileWrite($savedialog, $Txt) EndSwitch WEnd Cheers It doesn't work! Link to comment Share on other sites More sharing options...
James Posted May 15, 2007 Share Posted May 15, 2007 Have you tried fixing it? Hint: FileSaveDialog Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
November Posted May 15, 2007 Share Posted May 15, 2007 Have you tried fixing it? Hint: FileSaveDialogI didnt said anything Just watching Cheers Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font] 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