Jump to content

Recommended Posts

Posted

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

Hi,

See in help file about:

GUICtrlRead

FileWrite or FileWriteLine

Cheers :D

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]

Posted

#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

Posted

#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 :D

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]

Posted

Hi,

See in help file about:

GUICtrlRead

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!

Posted

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]

Posted

#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?
Posted

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]

Posted

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.

Posted

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.
Posted

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]

Posted

November.. Give him a chance to research!

LOL

My bad...

CODE REMOVED :D

LOOOOLLLOOOOL

I think i carried away the help :D

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]

Posted

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!
Posted

Have you tried fixing it?

Hint: FileSaveDialog

I didnt said anything :)

Just watching :D

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 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...