cappy2112 Posted October 2, 2009 Posted October 2, 2009 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
AdmiralAlkex Posted October 2, 2009 Posted October 2, 2009 (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 October 2, 2009 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
CodyBarrett Posted October 2, 2009 Posted October 2, 2009 (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 October 2, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
cappy2112 Posted October 2, 2009 Author Posted October 2, 2009 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!
GlyphMaker Posted October 3, 2009 Posted October 3, 2009 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.
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