numerouno Posted October 20, 2011 Share Posted October 20, 2011 Hello. I am new to AutoIt and look fowarding to mastering this useful tool. My first project is to create a script to enter a username and password into a dialog box in Firefox. I have found a script from googling but not sure what fields I need to change? AutoItSetOption("WinTitleMatchMode","2") if $CmdLine[0] < 3 then msgbox(0,"Error","Supply all the Arguments, Dialog title User Name, Password") Exit EndIf WinWait($CmdLine[1]) ; match the window with substring $title = WinGetTitle($CmdLine[1]) ; retrives whole window title ControlSend($title,"","Edit2",$CmdLine[2]);Sets User Name ControlSend($title,"","Edit3",$CmdLine[3]);Sets Password ControlClick($title,"","OK"); Can anyone offer me a little assistance on what I need to change to get this working? Thanks. Link to comment Share on other sites More sharing options...
Bert Posted October 20, 2011 Share Posted October 20, 2011 You will need to use The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
rosaz Posted October 20, 2011 Share Posted October 20, 2011 I'm new-ish myself, and not too familiar with using $CmdLine parameters myself. I'd probably write something (admittedly a bit rougher) like this: $windowname = "Name of your window here" $username = "your username here" $password = "your password here" WinWait($windowname) ControlSend($windowname, "", "Edit2", $username) ; you'll want to find out the control name of the username field (the easiest way to do this is to use the AutoIt Window Info tool), and sub it in for "Edit2" ControlSend($windowname, "", "Edit3", $password); same as above ControlClick($windowname, "", "text that appears that on the button you want to click") Link to comment Share on other sites More sharing options...
Bert Posted October 20, 2011 Share Posted October 20, 2011 (edited) What you have won't work at all. The ONLY way to interact with items displayed in Firefox is to use what I told you. You can't use ControlClick, controlsend or anything that tries to directly interact with a control that is displayed in the webpage that is displayed in Firefox. You can use "Send" as long as you make the Firefox window active first but this is horribly unreliable. This will only send text to the window in question and then if the cursor isn't in the field you want you have a failure. Seeing how you are a beginner you should take "Autoit 1 2 3. It is located in the example scripts section of the forum. Edited October 20, 2011 by MPH The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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