Jump to content

Recommended Posts

Posted

Hi guyz, im quite newbie + im not english speaking person, so as first excuse my english or stupidity. :D

So i need to ask someone, how can i by pressing GUI button, transfer text, that ill make in "GUICtrlCreateEdit" lane to ".txt" file, and than if its possible to import it back to script? For very easy example
 

$whatneedstobeexported = GUICtrlCreateEdit( "This text need to be exported to txt file when export button is pressed ")

$export = GUICtrlCreateButton("Export")

$import = GUICtrlCreateButton("Import")

;------------------------------------------------

While 1

Case $Export
FileWrite (export.txt, "" & $whatneedstobeexported)

Case $Import

---somehow read content of that export.txt and write it back to $whatneedstobeexported = GUICtrlCreateEdit---

EndSwitch
WEnd

 

I hope u understand what i want. :D Simply i need somehow STORE / RECALL (yeah thats the key thing) data from that "GUICtrlCreateEdit".

I know this script dont work - its written more than simple, and i need same simple (but working of course) answer how to do that. :D
So can anyone help me plz? (I havent found anywhere any hlp file or something, about "how to do that")
Thx

Posted (edited)

Have a look at these functions:

FileOpen
FileWrite
FileRead
GUICtrlSetData
GUICtrlRead
Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Posted

HI

Case $Import

 $filetext = FileRead(export.txt)

GUICtrlSetData($whatneedstobeexported,$filetext)

 

Not worky - unknown function name ^^ (im in hurry at work, so maybe it was mine mistake...ill check it later) ^^

Posted

I did, but lot of them havent worked as i expected. :/

When i maded that scripty and tryed it, it created that export file, but allways when button was pressed, it exported only "66" numbers and i dont know why. :D

66 is the controlID from creating the edit, which you have stored in $whatneedstobeexported. You need to read the value with the function I suggested GUICtrlRead() like so:

FileWrite("export.txt", GUICtrlRead($whatneedstobeexported))

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Posted

 

66 is the controlID from creating the edit, which you have stored in $whatneedstobeexported. You need to read the value with the function I suggested GUICtrlRead() like so:

FileWrite("export.txt", GUICtrlRead($whatneedstobeexported))

Amazing. It works. :) THats exactly what i needed. Thx man. :)

Posted

Not worky - unknown function name ^^ (im in hurry at work, so maybe it was mine mistake...ill check it later) ^^

Oh it works...i forgot on " " in there. My stupidity. Thx guys, my script is completed thx to u. :)

Posted

My pleasure. ;)

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...