I am trying to get the entire contents of a list box not just one selected item. Is there anyway to capture the entire list and write it to a text file?
Thanks
Getting all the items in a list box
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
The quick answer is YES.
It depends on what the source file is. If you are on a web page, you could open the source file and may be able to pull out the values there. You could search for the combo box code, copy it to a variable, then parse the variable to extract the select values and write them to a file.
Here is a rough outline of the process to follow on most generic files:
On most pages, you can create a loop that goes to the combo box.
Set counter of n=0
Start Looping
Press>Down*n, Enter
Copy value to clipboard, and store as %last value%
Send clipboard to variable
Append variable to the list file.
Add>n,1
Continue looping until the value copied is same as %last value%, now you know you have done them all. End the loop.
If not the same as %last value% then repeat the loop.
Again, this is just a quick and dirty flow chart to get started. Untested, needs fine tuning.
It depends on what the source file is. If you are on a web page, you could open the source file and may be able to pull out the values there. You could search for the combo box code, copy it to a variable, then parse the variable to extract the select values and write them to a file.
Here is a rough outline of the process to follow on most generic files:
On most pages, you can create a loop that goes to the combo box.
Set counter of n=0
Start Looping
Press>Down*n, Enter
Copy value to clipboard, and store as %last value%
Send clipboard to variable
Append variable to the list file.
Add>n,1
Continue looping until the value copied is same as %last value%, now you know you have done them all. End the loop.
If not the same as %last value% then repeat the loop.
Again, this is just a quick and dirty flow chart to get started. Untested, needs fine tuning.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Getting List Box Text
Bob, thank you for responding.
What I am looking is a way to get the text out of a MS list box that is in a Non-Modal Dialog Box. What the script is doing is adding lines and removing lines making the lines go up and down. But all that is one line at a time. I want to be able to just get all the lines in the order that they are displayed on the screen. What happens is when I add lines and remove lines and I save the file those lines are not change as the list box was just updated.
What I am looking is a way to get the text out of a MS list box that is in a Non-Modal Dialog Box. What the script is doing is adding lines and removing lines making the lines go up and down. But all that is one line at a time. I want to be able to just get all the lines in the order that they are displayed on the screen. What happens is when I add lines and remove lines and I save the file those lines are not change as the list box was just updated.
Keith,
If I'm understanding you correctly, you have a script that you are working with that has a non-modal dialog with a list box. That list box has a list that is changing while the script is processing. You want to know how to write that list to a file.
First, I'm sure you'll recognize that you are writing the list to a file at a moment in time. If the list continues to update, you will need to recreate or append to the file to reflect any updates.
There is a variable named [DIALOG_NAME].[LISTBOX_NAME].ITEMS.TEXT that contains the exact contents of the list box.
WriteLn>[FileName],result,%[DIALOG_NAME].[LISTBOX_NAME].ITEMS.TEXT%
will write the list box contents to a file.
Hope this helps,
Dick
If I'm understanding you correctly, you have a script that you are working with that has a non-modal dialog with a list box. That list box has a list that is changing while the script is processing. You want to know how to write that list to a file.
First, I'm sure you'll recognize that you are writing the list to a file at a moment in time. If the list continues to update, you will need to recreate or append to the file to reflect any updates.
There is a variable named [DIALOG_NAME].[LISTBOX_NAME].ITEMS.TEXT that contains the exact contents of the list box.
From Dialog ListBox Help wrote:Items is a list of items separated by %CRLF%. Creates variable defined by DialogName.Name set to the value of the item(s) selected by the user. Use DialogName.Name.Items.Text to set/retrieve the entire list at runtime. Optionally set multiselect to TRUE. If more than one item is selected in a multiselect list box DialogName.Name is set to the list of selected values separated by %CRLF%
WriteLn>[FileName],result,%[DIALOG_NAME].[LISTBOX_NAME].ITEMS.TEXT%
will write the list box contents to a file.
Hope this helps,
Dick
list item update
That is what I have been looking for. I will give it a shot. I'm sure it will work.
Thanks
Thanks