iggy Posted August 14, 2004 Posted August 14, 2004 Hi everyone 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?
Bartokv Posted August 14, 2004 Posted August 14, 2004 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!
trids Posted August 14, 2004 Posted August 14, 2004 iggy said: .. 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 ;get string from window $sValue = "pretend this is the string" ;Prompt the user $nRC = InputBox(@ScriptName, "Is this the value?", $sValue)
iggy Posted August 14, 2004 Author Posted August 14, 2004 (edited) Thanks for explanation. Quote AutoIt will stop execution whenever a message box or input box is displayedThat 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 August 14, 2004 by iggy
pekster Posted August 14, 2004 Posted August 14, 2004 iggy said: 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. iggy said: 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.
iggy Posted August 14, 2004 Author Posted August 14, 2004 Thanks a lot to all for the explanations and suggestions now my script is working fine
lakerguy5 Posted November 11, 2005 Posted November 11, 2005 how do you take info from user input and insert it at a later point of the script?
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