Sign in to follow this  
Followers 0
vanz

Using StdoutRead to populate a Listbox

3 posts in this topic

Hi all.

I've been exploring AutoIT for the last couple of days and am having a ball! But I've hit a hard spot for me and was hoping for some guidance.

I learned how to use StdoutRead to grab output from an external application but can't figure out how to turn that output into selections in a listbox.

In particular, what I have is a command line utility that outputs somthing like this:

Total number of Items: 4

Item1

Item2

Item3

Item4

What I want to do is to take that output and populate a listbox as individual selections but omit the first line that says "Total number of Items: <n>".

I'm stuck on both the removing of the first line and making each item a selection.

I'm sure it's a trivial thing to do, but I'm stuck. Any advice would be much appreciated.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$somenewvar = StringSplit(StringStripCR($thevarfromyourstdoutread), @LF)

Add to your listbox: $somenewvar[2], $somenewvar[3], $somenewvar[4], and $somenewvar[5].

Edited by xcal

Share this post


Link to post
Share on other sites

You are a rock star!

Thank you VERY much!

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