Sign in to follow this  
Followers 0
djaxis

Help with ListBoxes, New to AutoIT

8 posts in this topic

Hello

I just started using AutoIT and like it a lot so far. I do have a question I was hoping one of the experts can help with.

I am currently trying to automate the install of the IBM Software Update utility. I'm using it right now to update thinkpads with the latest drivers and IBM apps.

I get to a point where the Window displays a Listbox of all the IBM drivers/apps that need to get deployed. All the choices are automatically checked off by default. There are a few that I don't want installed so during the automation I want to uncheck 1 or 2 of the options. The Listbox is also fairly long so there is a slider on the right to scroll down and look at all the options. I'm not sure if that matters much to the solution.

Unfortunately for different models the list may vary so I can't count on using the SEND("{UP 5}") command for example.

How can I selectively choose/highlight a specific option, uncheck the box and then continue on? Any help would be greatly appreciated. Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

OK so after searching through the forums today I found on thread that is very similar to this question but there was no solution.

So I'm using the ContolListView FindItem and Select options and I am able to highlight the option in the listview box but I am unable to uncheck that highlighted option. If I up arrow or down arrow the highlighted option will go to the fist option in the list. At that point I can hit the spacebar and it will de-select that option.

It seems that even though the Item in the list is highlighted (Blue Box surrounding it) its not active (no dotted box around the edges if that makes sense)

Once active if I hit the spacebar the checkbox is unselected

What command can I use to activate the highlighted option so I can then send a {space} command to uncheck the highlighted option I get when using ControlListView. Thanks

Edited by djaxis

Share this post


Link to post
Share on other sites

Anyone have any ideas? Is this an impossible task? If I didn't explain something clearly let me know and I will do my best to clarify my problem. Thanks

OK so after searching through the forums today I found on thread that is very similar to this question but there was no solution.

So I'm using the ContolListView FindItem and Select options and I am able to highlight the option in the listview box but I am unable to uncheck that highlighted option. If I up arrow or down arrow the highlighted option will go to the fist option in the list. At that point I can hit the spacebar and it will de-select that option.

It seems that even though the Item in the list is highlighted (Blue Box surrounding it) its not active (no dotted box around the edges if that makes sense)

Once active if I hit the spacebar the checkbox is unselected

What command can I use to activate the highlighted option so I can then send a {space} command to uncheck the highlighted option I get when using ControlListView. Thanks

Share this post


Link to post
Share on other sites

Lookup ControlCommand in the help file



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Sweet, a response B) Thanks BigDod.

I wish it was as simple as ControlCommand (and it still very well might be, I am new to this)

Here is my code, it still does not work. It will highlight the text, the window is active but the highlighted text is not active if that means anything so I can't manipulate it even after the script is done.

Here is my code, I know it's somewhat of a brute force method but I'm learning.

Run("75pm09wwx.exe")

WinWaitActive("Software Installer - InstallShield Wizard", "I &accept the terms in the license agreement")

Send("!a")

SEND("!n")

WinWaitActive("Installation Program", "This program will be installed in the following folder:")

SEND("+{TAB}")

Send("{SPACE}")

SEND("{TAB}")

SEND("{SPACE}")

WinWaitActive("Software Installer", "This software makes installing drivers and software easy")

Send("!n")

WinWaitActive("Software Installer", "Find Updated Packages")

Send("!n")

WinWaitActive("Software Installer", "Please read the following license agreement carefully")

Send("!a")

SEND("!n")

Local $TargetItem1=ControlListView("Software Installer", "These packages may contain functional enhancements ", "SysListView321", "FindItem", "ThinkVantage Rescue

and Recovery")

Local $TargetItem2=ControlListView("Software Installer", "These packages may contain functional enhancements ", "SysListView321", "FindItem", "ThinkVantage Access

Connections (without wireless drivers)")

ControlListView("Software Installer", "These packages may contain functional enhancements ", "SysListView321", "Select", $TargetItem2)

ControlEnable("Software Installer", "", "SysListView321")

ControlCommand("Software Installer", "", "UnCheck", "")

Edited by djaxis

Share this post


Link to post
Share on other sites

When you use ControlCommand you have to give it some info so that it selects the correct control. In the example you posted you just tell it the window title, this is not enough. If you are unsure of the other info use the AutoIt Window Info tool to get the required info.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Thanks BigDod

So this information is something like

ControlCommand("Software Installer", "Software Updates", "SysListView321", "UnCheck", "")

I had left the text out because since it's been working with the same window I thought I could leave it out. I added the text "Software Updates" and the control ID "SysListView321" (also tried 1133 for the Control ID) and the command to Uncheck the box and still nothing. What am I missing here.

When you use ControlCommand you have to give it some info so that it selects the correct control. In the example you posted you just tell it the window title, this is not enough. If you are unsure of the other info use the AutoIt Window Info tool to get the required info.

Share this post


Link to post
Share on other sites

I appreciate you pointing me in the right direction BigDod

Unfortunately I can't get it to work. Obviously I must be missing something but for the life of me I can't figure it out. Anyone else have any tips?

Thanks

Thanks BigDod

So this information is something like

ControlCommand("Software Installer", "Software Updates", "SysListView321", "UnCheck", "")

I had left the text out because since it's been working with the same window I thought I could leave it out. I added the text "Software Updates" and the control ID "SysListView321" (also tried 1133 for the Control ID) and the command to Uncheck the box and still nothing. What am I missing here.

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