Aces Posted June 11, 2007 Share Posted June 11, 2007 What I'm trying to do is create a script that loads an inputbox (i know how to do that) and saves whatever is input into the box into a text/log file. I know I should do more searching but I'm really tired and just hoping someone could give a quick example code or direction. thanks. ~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public Link to comment Share on other sites More sharing options...
SpookMeister Posted June 11, 2007 Share Posted June 11, 2007 Look at GUICtrlRead in the help file [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
poisonkiller Posted June 11, 2007 Share Posted June 11, 2007 ...and FileWrite too. Link to comment Share on other sites More sharing options...
Aces Posted June 11, 2007 Author Share Posted June 11, 2007 (edited) could someone just post a quick example i could go off of? edit: thank you by the way #2 and #3 Edited June 11, 2007 by Aces ~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public Link to comment Share on other sites More sharing options...
/dev/null Posted June 11, 2007 Share Posted June 11, 2007 What I'm trying to do is create a script that loads an inputbox (i know how to do that) and saves whatever is input into the box into a text/log file.I know I should do more searching but I'm really tired and just hoping someone could give a quick example code or direction.thanks.$file = "d:\temp\data.txt"$data = InputBox("Data input", "Enter your data.")FileWriteLine($file,$data) __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
poisonkiller Posted June 11, 2007 Share Posted June 11, 2007 (edited) $text = InputBox("Test", "Write your text here", "") FileWrite("yourfilename.txt", $text & @CRLF) EDIT: damn, /dev/null was faster. Edited June 11, 2007 by poisonkiller Link to comment Share on other sites More sharing options...
Aces Posted June 11, 2007 Author Share Posted June 11, 2007 $file = "d:\temp\data.txt"$data = InputBox("Data input", "Enter your data.")FileWriteLine($file,$data)thank you ~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public Link to comment Share on other sites More sharing options...
/dev/null Posted June 11, 2007 Share Posted June 11, 2007 EDIT: damn, /dev/null was faster.and even though my laptop shut down just in the moment when I pressed the "Add Reply" button. So, I had to restart the damn thing... ;-)) __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Aces Posted June 11, 2007 Author Share Posted June 11, 2007 now how would i go with automatically numbering the lines 1,2,3,4,etc? ~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public Link to comment Share on other sites More sharing options...
poisonkiller Posted June 11, 2007 Share Posted June 11, 2007 Are you looking for FileReadLine()? Link to comment Share on other sites More sharing options...
Aces Posted June 11, 2007 Author Share Posted June 11, 2007 Are you looking for FileReadLine()?no, what I need is to know how to delete lines containing keywords that i input in the text file i specifyalso how to automatically number the notes i add to the text with FileWriteLine so if i type "Hello", it ends up as "1. Hello" on this list ~~ AutoIt v3 Minion ~~Name: Kevin "Aces-X" MorrisOrganization: A C DevelopmentE-Mail: AcesX91@acecoding.netOS: XP Professional; Vista package~~ Released Software ~~CPU-Mach: Topic at acecoding.net ForumsProxyzBuddy: Beta testing at the moment, private onlyWHSTool: Not released to the public Link to comment Share on other sites More sharing options...
poisonkiller Posted June 11, 2007 Share Posted June 11, 2007 no, what I need is to know how to delete lines containing keywords that i input in the text file i specifyI don't really understand what you mean, could you explain it a bit better? also how to automatically number the notes i add to the text with FileWriteLine so if i type "Hello", it ends up as "1. Hello" on this list#include <File.au3> $data = InputBox("Data input", "Enter your data.") If @error then Exit $file = @ScriptDir & "\test.txt" If FileRead($file) = "" Then $open = FileOpen($file, 1) FileWriteLine($open, "1. " & $data) Else $split = StringSplit(FileReadLine($file, _FileCountLines($file)), ".") $open = FileOpen($file, 1) FileWriteLine($open, Number($split[1]+1) & ". " & $data) EndIf FileClose($open) 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