This probably isnt what you want but try:

Code:
On *:Input:*: {
  if (.list == $1) {
    var %x = 1, %sdir = $$sdir= " Select Dir "
    while (%x <= $findfile(%sdir,$iif($2,$2,*.*),0)) {
      echo -a $+([,$findfile(%sdir,$iif($2,$2,*.*),%x),])
      inc %x
    }
    halt
  }
}