Sign in to follow this  
Followers 0
cappy2112

Starting Over again with AutoIt

5 posts in this topic

It's been a few years since I've used AutoIt, so I'm finally (and looking forward to it) to using it again.

The first thing I want to do is see if I can push two buttons in another app, from my AutoIt app.

I'm pretty sure I remember how to find the Window I want to automate by finding the TitleBar text in the target app.

What I really want to do is press two buttons- under program control.

I've snooped the target application with the AutoIt Window Info program, and it does see the two buttons I need to automate.

ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] )

looks like the API I need to use.

One concern is- I need to find the controlID of the buttons in order to automate them, right?

If some users are using version 1.0 of the target app (the program to be automated), and other users are using version 1.5 of the target app,

it's possible for the control ID to change from release to release.

How should an AutoIt program accommodate the value of a control ID being different from one release to another?

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Use "AutoIt Window Info" to find the ControlID.

If the ControlID's changes then you could try text or handles. See the page "Controls" in the helpfile.

Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

you dont need the controlID to use Control... () controls... you can use CTRLID\hWnd\ClassNN and autoit will automatically detect which your using and will find that control....

EDIT ugh XD didn't read Admirals post completely :)

Edited by CodyBarrett

Share this post


Link to post
Share on other sites

Use "AutoIt Window Info" to find the ControlID.

If the ControlID's changes then you could try text or handles. See the page "Controls" in the helpfile.

I see- so then I don't really need the control ID, just the text of the button.

That's great- that should eliminate control ID changes in any version of the target app software.

Thanks!

Share this post


Link to post
Share on other sites

I see- so then I don't really need the control ID, just the text of the button.

That's great- that should eliminate control ID changes in any version of the target app software.

Thanks!

This question is relevant to me right now as well. How the answer above actually works is less apparent, though, to the uber-noob, here, than it is to cappy. Is there a slightly less terse example of the actual syntax and adjacent code required to ferret-out enough information about the button to push it, when only the text on its face is a given? Again, a reference, without one having to re-mix the reply would even be helpful.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0