sebmeikle Posted February 13, 2010 Share Posted February 13, 2010 Could someone spare a few minutes to write a small script for me. I've tried doing it myself, this is probably a very simple macro but I don't want to spend hours for somthing that could be done in a few minutes. What I need is a script that will open this program: http://www.mediafire.com/?mdjwjwho4dd ICON 225 USB Connect(824Kb) Then click "Show settings" and enter the three login credentials User Name, Password and APN(Access Point Name). Click the Save button then click Connect. I can easily edit the script to change the location of the program and edit the user name, password and apn. I would really appreacite this. Link to comment Share on other sites More sharing options...
darkjohn20 Posted February 13, 2010 Share Posted February 13, 2010 You might want to rephrase the question. Just about everybody on here will tell you that they're not going to write anything for you. A hint: Provide some code that doesn't work, and ask for some help fixing it. Link to comment Share on other sites More sharing options...
sebmeikle Posted February 13, 2010 Author Share Posted February 13, 2010 Ok, that's fair enough. I've started writing one but I can't work out how to make the macro select a specific text box and add the text. This is what I have so far: ; Veryfy To Start $answer = MsgBox(4, "Connect Utility by Seb Meikle", "Connect to Orange 3G?") If $answer = 7 Then Exit EndIf ;Run Utility Run ("c:\orange\ICON 225 USB Connect.exe") WinWaitActive ("ICON 225 USB Connect") ;Add Credentials I assume I have to use the AutoIt Window Info Tool to get the information about each editable text box and buttons. Link to comment Share on other sites More sharing options...
darkjohn20 Posted February 13, 2010 Share Posted February 13, 2010 Use the window info tool to get the class of the box if you can, and use that in Controlsettext Link to comment Share on other sites More sharing options...
sebmeikle Posted February 13, 2010 Author Share Posted February 13, 2010 Hmm. I'm so new to all this. This is what I have done, but I am getting a error(Incorrect amount of call functions). ;Add Credentials ControlSetText ("ICON 225 USB Connect", "Multimedia", 1023) Title - I assume this is the title of the window? Text - I'm guessing this is the text I want entered into the text box. ControlID - I guess this is the ID of the text box. NewText - What this? Flag - Whats this? Many Thanks Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 13, 2010 Share Posted February 13, 2010 Function ControlSetTextThe parameters and an example too are on the page. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
darkjohn20 Posted February 13, 2010 Share Posted February 13, 2010 Text is some text on the window you want to access, leave it "" unless you have 2 windows with the Title. Newtext is the text you want to go there. Flag can be 0 or not used at all. Link to comment Share on other sites More sharing options...
sebmeikle Posted February 13, 2010 Author Share Posted February 13, 2010 Ok, thanks for all your help. I managed to get it to work. Just wanted an opinion on this script. ; Veryfy To Start $answer = MsgBox(4, "Connect Utility by Seb Meikle", "Connect to Orange 3G?") If $answer = 7 Then Exit EndIf ;Run Utility Run ("c:\orange\ICON 225 USB Connect.exe") WinWaitActive ("ICON 225 USB Connect") ;Add Credentials ControlSetText("ICON 225 USB Connect", "", 1023, "Multimedia") ControlSetText("ICON 225 USB Connect", "", 1025, "Orange") ControlSetText("ICON 225 USB Connect", "", 1015, "orangewap") ;Save ControlClick ("ICON 225 USB Connect", "Save", 1016) ;Connect ControlClick ("ICON 225 USB Connect", "Connect", 1017) I know it works, but is this coded correctly? Is this how code should be layed out etc.. P.s The login details are universial so it doesn't matter that people can see them. Link to comment Share on other sites More sharing options...
darkjohn20 Posted February 13, 2010 Share Posted February 13, 2010 Looks good to me. Link to comment Share on other sites More sharing options...
sebmeikle Posted February 13, 2010 Author Share Posted February 13, 2010 I have one more question. When the program is started it needs a few seconds(between 2 and 5) to register its-self to the network. When this has happened it says "Register to Orange" in the status bar. How would I make the script pause untill this has happened? What is the script command? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 13, 2010 Share Posted February 13, 2010 Sleep and maybe StatusbarGetText - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
junkew Posted February 13, 2010 Share Posted February 13, 2010 It will help if you tell the classname which is given by AU3Info / Autoit window info tool StatusbarGetText ( "title" [, "text" [, part]] ) will probably work. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
sebmeikle Posted February 13, 2010 Author Share Posted February 13, 2010 Cheers. The sleep function did the trick. Thank you for all your help. 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