I am presuming it is a side listbox in a custom window, if not, I've got it wrong!!!! (again!!)

Code:
alias GetListbox {
  if ($line($active,0,1) == $null) { halt }
  .write -c "Listbox Contents.txt"
  [color:green];I have put these into variables so as to reduce code later on (the ---- line)[/color]
  var %a Contents of the list box for $active
  var %b Saved by $me on $asctime
  .write "Listbox Contents.txt" %a
  .write "Listbox Contents.txt" %b
  .write "Listbox Contents.txt" $str($chr(45),$iif($len(%a) > $len(%b),$len(%a),$len(%b)))
  var %i = 1
  while %i <= $line($active,0,1) {
    .write "Listbox Contents.txt" $line($active,%i,1)
    inc %i
  }
  .run "Listbox Contents.txt"
}


Probably too much code there than needs to be, but thought I'd make it anyway!

Hope it's what you want.