put them to an array and use it. myarray = [] myarray = $ie.select_list(:whatever, 'whatever').getAllContents now you can see which one is your text by doing myarray.length.times do |x| puts "index" + "#{x}" + " " + "#{myarray[x]}" end