bluefoxreg Posted February 16, 2015 Share Posted February 16, 2015 Sorry I'm an AutoIt newbie, so please bare with me. Here's the program I'm trying to interact with (you might need bluestack installed?) https://drive.google.com/file/d/0B8l0ohDhxeO7ZWtnZ05PcGIzd0U/view?usp=sharing Here's what I have so far #Include <GuiComboBox.au3> #Include <GuiComboBoxEX.au3> #include <GUIListBox.au3> #include <GUIConstantsEx.au3> $winActive = WinActivate("BlueStacks Tweaker 3.11") local $shcombo = ControlGetHandle($winActive, "", 'TComboBox4') _GUICtrlComboBox_SelectString($shcombo, 'Profile 13') ;~ If ControlCommand($winActive, '', 'TComboBox4', 'FindString', 'Profile 13') <> 0 Then ;~ ControlCommand($winActive, '', 'TComboBox4', 'SelectString', 'Profile 13') ;~ EndIf MsgBox(0,"", ControlGetText($winActive, '', 'TComboBox4')) The odd thing is I can print the text of the control, but I can't get/set of its values (with either GUICtrl or ControlCommand)? Is it because the program is using custom controls? Any suggestions? What I wanted to do is: 1. Open the program 2. Select Profile 1 3. Press Load 4. Select Start BS 5. Select Stop BS 6. Repeat 2 until X times 7. Close program Any help would be greatly appreciated! Link to comment Share on other sites More sharing options...
bluefoxreg Posted February 16, 2015 Author Share Posted February 16, 2015 Well, I finally got pass the not able to get the control's Text, its because the Tweaker needs to be run with Elevated Privileges, so my Autoit also needs to be run with Elevated Privileges. However, I still can't seem to set the value of the control, I tried the following combos, #Include <GuiComboBox.au3> #Include <GuiComboBoxEX.au3> #include <GUIListBox.au3> #include <GUIConstantsEx.au3> $winActive = WinActivate("BlueStacks Tweaker 3.11") local $shcombo = ControlGetHandle($winActive, "", 'TComboBox4') ;~ _GUICtrlComboBox_SelectString($shcombo, 'Profile 13') ;~ ControlCommand($winActive, '', 'TComboBox4', 'ShowDropDown') ;~ ControlSend($winActive, '', 'TComboBox4', 'Profile 13') $Index = _GUICtrlComboBoxEx_FindStringExact($shcombo, 'Profile 13') _GUICtrlComboBoxEx_SetCurSel($shcombo, $Index) If I output the text of the control, it is change by my code. However, the program seems to be ignoring the change of the value for some reason and the display of the dropdown is also not updated? Thoughts? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 17, 2015 Moderators Share Posted February 17, 2015 1. Have you looked through all these? http://goo.gl/liwbdm 2. Have you tried >IUIAutomation? 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...
bluefoxreg Posted February 18, 2015 Author Share Posted February 18, 2015 Yes I've googled before I post here. My issue is not with the bluestack itself, but the specific program BlueStacks Tweaker 3.11 (the one I included in my first post). I'm interested in find out why I am able to read the dropdowns/buttons's title, but not able to interact with it with autotit. (The autoit info too seems to be be able to get the control states with no problem it seem.... ) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 18, 2015 Moderators Share Posted February 18, 2015 (edited) Don't use "ControlGetText" on a combo box. Two choices... 1. ControlCommand (see help file) 2. _GUICtrlComboBox* functions (_GUICtrlComboBox_GetEditText()) Combo boxes are lists, not edits. Edited February 18, 2015 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...
bluefoxreg Posted February 18, 2015 Author Share Posted February 18, 2015 Thanks for the reply but you're kind of missing my points here. Here is what I'm trying to do: 1. Change the profile menu to Profile 3 2. Press the Load button Now as I've indicated in my first post, I've tried various different combinations of the ControlCommand _GUICtrlComboBox* to set/press the button. I merely indicate that ControlGetText works, but that really has nothing to do with the problem I'm trying to solve here. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 18, 2015 Moderators Share Posted February 18, 2015 I didn't miss your point. Your first thread read that you tried GUICtrl functions ... well those are for AutoIt controls only which is why I offered the suggestion. I saw you used "1" method for _GUICtrlComboBox*, I was offering another. Did you bother with IUIAutomation? 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...
jdelaney Posted February 18, 2015 Share Posted February 18, 2015 (edited) I've noticed the same behavior with the _guictrlcombo functions...you need to perform multiple of these functions to get some guis to recognize that an actual change was made (an not just update the text value) Try to focus prior, and keep with the controlcommand route: local $shcombo = ControlGetHandle($winActive, "", 'TComboBox4') ControlFocus($winActive,"",$shcombo) ControlCommand($winActive,"",$shcombo,"SelectString", 'Profile 13') Edited February 18, 2015 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
bluefoxreg Posted February 19, 2015 Author Share Posted February 19, 2015 Thanks for the suggestion, unfortunately focusing it multiple times or sending the command multiple times doesn't pan out. I've noticed the same behavior with the _guictrlcombo functions...you need to perform multiple of these functions to get some guis to recognize that an actual change was made (an not just update the text value) Try to focus prior, and keep with the controlcommand route: local $shcombo = ControlGetHandle($winActive, "", 'TComboBox4') ControlFocus($winActive,"",$shcombo) ControlCommand($winActive,"",$shcombo,"SelectString", 'Profile 13') 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