Trini Posted March 31, 2006 Share Posted March 31, 2006 I am trying to automate the installation of a dictionary program call WordWeb. The control IDs for most of its buttons change with each install. I need a script that will find the current control ID so I can use the ControlClick option. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 31, 2006 Moderators Share Posted March 31, 2006 (edited) I am trying to automate the installation of a dictionary program call WordWeb. The control IDs for most of its buttons change with each install. I need a script that will find the current control ID so I can use the ControlClick option.Do the ClassNameNN(s) change? I generally use those more so than the ControlID's.Also, there is a UDF that LxP made to get the ConrolNameNN from a specific position if all else fails.Edit:Here's the link if the ClassNameNN(s) change too.http://www.autoitscript.com/forum/index.ph...topic=14323&hl= Edited March 31, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Trini Posted March 31, 2006 Author Share Posted March 31, 2006 Do the ClassNameNN(s) change? I generally use those more so than the ControlID's.Also, there is a UDF that LxP made to get the ConrolNameNN from a specific position if all else fails.Edit:Here's the link if the ClassNameNN(s) change too.http://www.autoitscript.com/forum/index.ph...topic=14323&hl=I thought of using the ClassNameNN but could not find an example in the help files. I have only been using this program for the last three days so I will need some assistance. I tried the link but I attmepts failed. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 31, 2006 Moderators Share Posted March 31, 2006 (edited) >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 185 Y: 37 W: 62 H: 29 Control ID: 81 ClassNameNN: Button24 Text: C Example:If Not ProcessExists('calc.exe') Then Run('Calc.exe') WinWait('Calculator', '', 10) If Not WinActive('Calculator') Then WinActivate('Calculator') Else If Not WinActive('Calculator') Then WinActivate('Calculator') ControlClick('Calculator', 'C', 'Button24') EndIf ControlClick('Calculator', '7', 'Button5') Sleep(1000); just so you can see it ControlClick('Calculator', '+', 'Button20') Sleep(1000) ControlClick('Calculator', '3', 'Button15') Sleep(1000) ControlClick('Calculator', '=', 'Button21') MsgBox(64, 'Sum', 'The sum on Calculator should be 10?')Edit: Messed up WinWait()... sorry. Edited March 31, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Trini Posted March 31, 2006 Author Share Posted March 31, 2006 Example:If Not ProcessExists('calc.exe') Then Run('Calc.exe') WinWait('Calculator', '', 10) If Not WinActive('Calculator') Then WinActivate('Calculator') Else If Not WinActive('Calculator') Then WinActivate('Calculator') ControlClick('Calculator', 'C', 'Button24') EndIf ControlClick('Calculator', '7', 'Button5') Sleep(1000); just so you can see it ControlClick('Calculator', '+', 'Button20') Sleep(1000) ControlClick('Calculator', '3', 'Button15') Sleep(1000) ControlClick('Calculator', '=', 'Button21') MsgBox(64, 'Sum', 'The sum on Calculator should be 10?')Edit: Messed up WinWait()... sorry. Thanks for your assistance thus far. As you may have already figured out I am not only new to AutoIt but new to writing scripts. I know the AutoIt Window Info program will give me the ClassNameNN. However I do not know how to get ClassNameNN by running a script. By the way what was the calculator script for. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 31, 2006 Moderators Share Posted March 31, 2006 Hmmm...Well the calculator script was to show you how I used the information that I got from the AutoInfo tool.You actually have to get the information from each window/button/etc... you want to interact with using AutoInfo.exe so you can impliment them in your script.After you have that information, you then write the script.... and that's all it takes... they shouldn't change from that point on.You also may want to take a look at a tutorial: http://www.autoitscript.com/forum/index.php?showtopic=21048P.S. What program are you trying to automate? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Trini Posted March 31, 2006 Author Share Posted March 31, 2006 Hmmm...Well the calculator script was to show you how I used the information that I got from the AutoInfo tool.You actually have to get the information from each window/button/etc... you want to interact with using AutoInfo.exe so you can impliment them in your script.After you have that information, you then write the script.... and that's all it takes... they shouldn't change from that point on.You also may want to take a look at a tutorial: http://www.autoitscript.com/forum/index.php?showtopic=21048P.S. What program are you trying to automate?The program is called WordWeb. It is a free dictionary program. Thanks for the toturial program, it will be of great help to me. I am not sure you understand the problem I am getting. The ClassNameNN does not change. I am unable to find an example that uses ClassNameNN. All the examples that came with AutoIt uses Control ID. So I am looking for a script the retrive the ClassNameNN for a control. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 31, 2006 Moderators Share Posted March 31, 2006 I gave you an Example using ClassNameNN? What are you talking about? Just replace Control ID with ClassNameNN... That simple. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 31, 2006 Moderators Share Posted March 31, 2006 I have installed WordWeb... what do you want to do? ... It seems that WordWeb uses some"TPanel" controls that contain buttons. These buttons are not controls themselves... just part of the TPanel... This window may need some advanced techniques to automate...LAr.Ha... my laziness (didn't download it) has been exceeded by our AutoIt Guru... take some notes and explain in detail, larry's the man!! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Trini Posted March 31, 2006 Author Share Posted March 31, 2006 The program is called WordWeb. It is a free dictionary program. Thanks for the toturial program, it will be of great help to me. I am not sure you understand the problem I am getting. The ClassNameNN does not change. I am unable to find an example that uses ClassNameNN. All the examples that came with AutoIt uses Control ID. So I am looking for a script the retrive the ClassNameNN for a control.I think the problem is not on your end but on my end. Since I am new to this I am not explaining myself clearly. I should have told you that before I made this post I tried the ClassNameNN instead of Control ID. Everytime I did that I got a syntax error when I ran the script. The following is an example, where TCheckBox1 is the ClassNameNN.E:\Downloads\Burn\WordWeb\New AutoIt v3 Script.au3(29,68) : ERROR: syntax errorControlClick ( "WordWeb Setup","Install for all users", TCheckBox1 )~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^E:\Downloads\Burn\WordWeb\New AutoIt v3 Script.au3 - 1 error(s), 0 warning(s)This is the reason I was trying to locate a script that will give the the current Control ID. A script that gives me the ClassNameNN will also work.What I should have done was to show you the error I am getting and work from there. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 31, 2006 Moderators Share Posted March 31, 2006 My only suggestion... would be the UDF that I posted originally by LxP if you know the x and y positions... maybe larry can come up with something else. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Trini Posted March 31, 2006 Author Share Posted March 31, 2006 This installs with defaults to all users... see TCheckBox1 reference below... Run("""" & @ScriptDir & "\WordWeb.exe""") WinWait("WordWeb","Accept") ControlClick("WordWeb","Accept","Accept") WinWait("WordWeb Setup","Install to the system tray") ControlClick("WordWeb Setup","Install to the system tray","&Next >") WinWait("WordWeb Setup","Install for all users") ControlClick("WordWeb Setup","Install for all users","TCheckBox1") Sleep(500) ControlClick("WordWeb Setup","Install for all users","&Next >") WinWait("WordWeb Setup","Your English locale") ControlClick("WordWeb Setup","Your English locale","Install") WinWait("WordWeb Setup","Help") ControlClick("WordWeb Setup","Help","OK") EDIT: There may also be the "text" of the TCheckBox control that can be used... just like I used the text of the buttons to click them... Thanks, I really appreciate the efforts guys! Link to comment Share on other sites More sharing options...
quielb Posted March 31, 2006 Share Posted March 31, 2006 Nobody mentioned it but just to help you out. The reason you were getting a syntax error was that you ClassNameNN had to be enclosed in quotes also. You left the clasenameNN bare. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 31, 2006 Moderators Share Posted March 31, 2006 Nobody mentioned it but just to help you out. The reason you were getting a syntax error was that you ClassNameNN had to be enclosed in quotes also. You left the clasenameNN bare.The example I gave had it in quotes. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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