# Text in editbox save as a txt file

## Recommended Posts

How can I save the text, that I typed in the editbox, as a txt file?

##### Share on other sites

How can I save the text, that I typed in the editbox, as a txt file?

Hi,

FileWrite 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]

##### Share on other sites

#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 #### Share this post ##### Link to post ##### Share on other sites #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]

##### Share on other sites

Hi,

FileWrite or FileWriteLine

Cheers

But then it saves Line 1, Line 2, ... in a txt file and not the text I typed in the editbox!

##### Share on other sites

November, agreed I should let them. But I am being helpful. Thanks for the comment!

Tobi, there is an example above ^^

##### Share on other sites

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]

##### Share on other sites

#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? #### Share this post ##### Link to post ##### Share on other sites Replace the C:\text.txt with the name that you want to give it. #### Share this post ##### Link to post ##### Share on other sites Replace the C:\text.txt with the name that you want to give it. Hehehe Or :$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]

##### Share on other sites

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. #### Share this post ##### Link to post ##### Share on other sites 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.

##### Share on other sites

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 by Secure_ICT

##### Share on other sites

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] #### Share this post ##### Link to post ##### Share on other sites November.. Give him a chance to research! #### Share this post ##### Link to post ##### Share on other sites November.. Give him a chance to research! LOL My bad... CODE REMOVED LOOOOLLLOOOOL I 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] #### Share this post ##### Link to post ##### Share on other sites Bad boy *he needs an ass whipping* KAT!!!! tobi, have you done it yet? #### Share this post ##### Link to post ##### Share on other sites 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!

##### Share on other sites

Have you tried fixing it?

Hint: FileSaveDialog

##### Share on other sites

Have you tried fixing it?

Hint: FileSaveDialog

I 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]

## Create an account

Register a new account