Cave Posted February 16, 2006 Share Posted February 16, 2006 I am somewhat new to AutoIT scripting... I've written a few scripts that work well but I am having trouble getting the controlcommand function to work with the "SelectString" argument to select an item in a ListBox. Here is the snipet of my script: WinWaitActive("Select State(s) to Process") ControlFocus("Select State(s) to Process","",1008) ControlCommand("Select State(s) to Process","",1008,"SelectString",'ALASKA') 1008 represents the ControlID of "ListBox1" according to the AutoIT active window utility. When I run this script the Control Focus works but "ALASKA" is not selected from the ListBox of states. Any help would be greatly appreciated! Eventually I want to replace 'ALASKA' in the function with a variable that is obtained from a user response, but I think I can figure that part out on my own.... Thanks!! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 16, 2006 Moderators Share Posted February 16, 2006 (edited) Have you tried using the ClassNameNN instead of the ControlID? Edit: I really don't see where that would change anything to be honest, so I'll ask this... is the listbox from a standard windows application, and 2.. are we sure that our title is 100% accurate? Edited February 16, 2006 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...
Cave Posted February 17, 2006 Author Share Posted February 17, 2006 Have you tried using the ClassNameNN instead of the ControlID?Edit:I really don't see where that would change anything to be honest, so I'll ask this... is the listbox from a standard windows application, and 2.. are we sure that our title is 100% accurate?You are correct; using the ClassNameNN had no effect. I am sure the title is 100% accurate. I copied it from other command functions on that listbox that seem to work (arrow up, down, etc). The listbox is from a "home grown" windows application that we developed from the ground up by our internal MIS software Dept. It is an application written in C++. I don't know anything about the code, but it looks and functions like a standard Windows app to me. The ClassNameNN is "ListBox1" - doesn't that indicate a standard Windows listbox?? 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