ctyankeeinok Posted August 18, 2009 Share Posted August 18, 2009 I have a script that is automating installation of printer drivers. I have seen where the instance number very same "OK" button changes depending on other things happening on the PC. What is going on? I have been using ControlClick($title,$text,"[CLASS:Button,Instance:3]","Primary") , but found that at times the script does not run properly because now the instance number is different. What should I be using to identify the control? Just the ID like [iD: 3]? Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 18, 2009 Share Posted August 18, 2009 I have a script that is automating installation of printer drivers. I have seen where the instance number very same "OK" button changes depending on other things happening on the PC. What is going on? I have been using ControlClick($title,$text,"[CLASS:Button,Instance:3]","Primary") , but found that at times the script does not run properly because now the instance number is different. What should I be using to identify the control? Just the ID like [iD: 3]? You have to use whatever will remain consistent. What works varies by the GUI you are working with. Maybe the ControlID is consistent, maybe X/Y coordinates, maybe the control text (i.e. "&Next"), etc. >_< 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...
LarryDalooza Posted August 18, 2009 Share Posted August 18, 2009 When controls are created or destroyed at runtime, then there are more or less of them so enumerating controls (what the instance derivative is) returns different numbers. This is why we give several ways of identifying controls. Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
ctyankeeinok Posted August 18, 2009 Author Share Posted August 18, 2009 Thank you! 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