iggy 0 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? Share this post Link to post Share on other sites
Bartokv 1 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! Share this post Link to post Share on other sites
trids 2 Posted August 14, 2004 .. 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) Share this post Link to post Share on other sites
iggy 0 Posted August 14, 2004 (edited) Thanks for explanation.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 Share this post Link to post Share on other sites
pekster 0 Posted August 14, 2004 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. Share this post Link to post Share on other sites
iggy 0 Posted August 14, 2004 Thanks a lot to all for the explanations and suggestions now my script is working fine Share this post Link to post Share on other sites
lakerguy5 0 Posted November 11, 2005 how do you take info from user input and insert it at a later point of the script? Share this post Link to post Share on other sites