Lukepro2315 Posted April 7, 2015 Posted April 7, 2015 Hi guyz, im quite newbie + im not english speaking person, so as first excuse my english or stupidity. 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. 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. So can anyone help me plz? (I havent found anywhere any hlp file or something, about "how to do that") Thx
MikahS Posted April 7, 2015 Posted April 7, 2015 (edited) Have a look at these functions: FileOpen FileWrite FileRead GUICtrlSetData GUICtrlRead Edited April 7, 2015 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy 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
Zobengrauzis Posted April 7, 2015 Posted April 7, 2015 HI Case $Import $filetext = FileRead(export.txt) GUICtrlSetData($whatneedstobeexported,$filetext)
Lukepro2315 Posted April 7, 2015 Author Posted April 7, 2015 HI Case $Import $filetext = FileRead(export.txt) GUICtrlSetData($whatneedstobeexported,$filetext) Thx. Thats what i need to import. Go to try that
Lukepro2315 Posted April 7, 2015 Author Posted April 7, 2015 Have a look at these functions: FileOpen FileWrite FileRead GUICtrlSetData GUICtrlRead 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.
Lukepro2315 Posted April 7, 2015 Author Posted April 7, 2015 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) ^^
MikahS Posted April 7, 2015 Posted April 7, 2015 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. 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 ~ getENVvarsMy 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
Lukepro2315 Posted April 10, 2015 Author Posted April 10, 2015 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.
Lukepro2315 Posted April 10, 2015 Author Posted April 10, 2015 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. SadBunny 1
MikahS Posted April 11, 2015 Posted April 11, 2015 My pleasure. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy 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
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