Jump to content

Input Problems


iggy
 Share

Recommended Posts

Hi everyone :ph34r:

Im learning using autoit and i have this kind of problem.

I need to get a variable from a string copied.

I mean i let autoit copy a word in a window and then i want to paste in a InputBox but when the InputBox appears autoit stop working waiting for a human input.

Is a way to do this or a different way to copy a word and use it like a varible in an autoit script?

Link to comment
Share on other sites

AutoIt will stop execution whenever a message box or input box is displayed. However, you may specify a timeout like in my example below:

$string = "Sample text"
$text = InputBox("Window Title", "Enter some text below.", $string, "", -1, -1, -1, -1, 5)
MsgBox(4096, "Message", "You entered: " & Chr(34) & $text & Chr(34))

(The -1 values tell the command to use the default options)

Hope this helps!

Link to comment
Share on other sites

.. i let autoit copy a word in a window and then i want to paste in a InputBox but when the InputBox appears autoit stop working waiting for a human input...

<{POST_SNAPBACK}>

Sounds like you're looking for the default parameter to the InputBox function :ph34r:

;get string from window
    $sValue = "pretend this is the string"

;Prompt the user
    $nRC = InputBox(@ScriptName, "Is this the value?", $sValue)
Link to comment
Share on other sites

Thanks for explanation.

AutoIt will stop execution whenever a message box or input box is displayed

That means im using the wrong way to to catch up my scope.

Does exist a command that allow Autoit to get an information (like copy a string or a word that can change in the time) and use it in the script like a $var?

Or a command that read a word in a txt file for example so it is possible to convert it in a $var .

Edited by iggy
Link to comment
Share on other sites

Does exist a command that allow Autoit to get an information (like copy a string or a word that can change in the time) and use it in the script like a $var?

<{POST_SNAPBACK}>

Sure, but it all depends on where you want to copy it from. From another variable, user input, a file, a window title, etc etc. There are many many commands to get various pieces of information.

Or a command that read a word in a txt file for example so it is possible to convert it in a $var .

<{POST_SNAPBACK}>

If you want to read a text file, you'll want to look at FileReadLine, FileRead, and FileOpen. You can read lines (or the whole file) into a variable, and parse it as needed to search for any information contained inside them.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

  • 1 year later...

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