urmommie Posted April 13, 2009 Share Posted April 13, 2009 (edited) Im new but I learned some of the help of this awesome forum ! Well I just made this code and I wanted to add something but I can't here is the code: $answer = InputBox("Login", "What is your username?") Run("Notepad") WinWait("Untitled - Notepad") WinWaitActive("Untitled - Notepad") Send("Welcome {$answer}!") EndIf What I want it to do is when they type their name the notepad opens and it says Welcome {the name they typed}! please help Edited April 13, 2009 by urmommie Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 13, 2009 Share Posted April 13, 2009 Im new but I learned some of the help of this awesome forum ! Well I just made this code and I wanted to add something but I can't here is the code: $answer = InputBox("Login", "What is your username?") Run("Notepad") WinWait("Untitled - Notepad") WinWaitActive("Untitled - Notepad") Send("Welcome {$answer}!") EndIf What I want it to do is when they type their name the notepad opens and it says Welcome {the name they typed}! please help Where did you get the idea that curly braces allow you to insert a variable into a string? Some other language, no doubt. This is AutoIt, use the AutoIt help file and run the simple tutorials in it to learn how AutoIt uses strings. In this case you have to assemble the part before the variable, the variable contents, and the part after the variable with the append (ampersand) operator: Send("Welcome " & $answer & "!") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Exit Posted April 13, 2009 Share Posted April 13, 2009 Just another solution with embedded variable ;-)Opt("ExpandVarStrings", 1) $answer = InputBox("Login", "What is your username?") Run("Notepad") WinWaitActive("[Class:Notepad]") ; to accept other languages title. Send("Welcome $answer$!",1) ; "1" to send it raw App: Au3toCmd UDF: _SingleScript() 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