kali999 Posted September 24, 2012 Posted September 24, 2012 Hi, I'm confused, i want to click button by the text, but my button have very long name "Verify the system structure and fix problems" how can i use controlclick too hit it ? i have code : While 1 $next = ControlClick("[TITLE:Recovery Manager]", "", "[CLASS:Button; INSTANCE:10]") If $next = "Verify the system structure and fix problems" Then ExitLoop Sleep(4000) WEnd But it doesn't work Is there any possibility to use shorter text like "Verify~" ?
PhoenixXL Posted September 24, 2012 Posted September 24, 2012 (edited) use Autoit Window Info Tool to get the Control Id of the Button and then use it for controlclick Edit: BTW the function returns a boolean value [not the value of the button] Edited September 24, 2012 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
kali999 Posted September 24, 2012 Author Posted September 24, 2012 Yeah i know that i can use ID's but i would like to operate on TEXT, another problem is that when i use more than one While loop script works only for first one, when it going to ::next button it doesn't recognize or just freezing i don't know , any ideas? I just want to my script recognize text in buttons and go to the next position which is almost the same. ::yes Button While 1 $text = ControlClick("[TITLE:testing app]", "", "[CLASS:Button; INSTANCE:4]") If $text = "No" Then ExitLoop Sleep(2000) Wend ControlClick("[TITLE:testing app]", "", "[CLASS:Button; INSTANCE:4]", "left") Sleep(2000) ::Next Button While 1 $text = ControlClick("[TITLE:testing app]", "", "[CLASS:Button; INSTANCE:6]") If $text = "Next" Then ExitLoop Sleep(2000) Wend ControlClick("[TITLE:testing app]", "", "[CLASS:Button; INSTANCE:6]", "left") Sleep(2000)
Moderators Melba23 Posted September 24, 2012 Moderators Posted September 24, 2012 kali999,Is there any possibility to use shorter textTry using Opt("WinTitleMatchMode", 2). I know it works for window titles - so I imagine it might work for other controls as well. Please let us know how you get on. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
DanielTyrkiel Posted September 24, 2012 Posted September 24, 2012 from what I understand ControlClick() is the function that performs the clicking action so the only value for your $text variable would be success or failure (0 or 1)
kali999 Posted September 25, 2012 Author Posted September 25, 2012 from what I understand ControlClick() is the function that performs the clicking action so the only value for your $text variable would be success or failure (0 or 1)Yeah but the text compare works fine, what i see i have problem with clicking, i have tried many possibilities but it's not problem with text but with button, it's suppose to click button when it find but it clicking without any reaction, something like click the button with mouse and before releasing left button you move mouse from button area. Any clue ? I don't want to use mouseclick ;S Thanks to support
kali999 Posted September 25, 2012 Author Posted September 25, 2012 kali999,Try using Opt("WinTitleMatchMode", 2). I know it works for window titles - so I imagine it might work for other controls as well. Please let us know how you get on. M23I tried Opt but it seems doesn't work for Buttons
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