Jump to content

InputBox Logging


Recommended Posts

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

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

could someone just post a quick example i could go off of?

edit: thank you by the way #2 and #3

Edited 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

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

$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

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

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

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 specify

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

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

no, what I need is to know how to delete lines containing keywords that i input in the text file i specify

I 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

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
 Share

  • Recently Browsing   0 members

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