set chosenShow to (choose from list seriesResultsNames with title "TV Show Maker 3.0" with prompt "Please select correct TV Show, then press OK." default items item 1 of seriesResultsNames)
set showID to ""
repeat with i from 1 to seriesCount
if chosenShow is equal to (item 2 of item i of seriesResults as text) then
set showID to item 1 of item i of seriesResults
return
end if
end repeat
I have a list of lists called seriesResults, each list in it has 3 items. seriesResultsNames is a list of item 2 from each list in seriesResults. So for example seriesResults is {{one, two, three}, {four, five, six}} and seriesResultsNames is {two, five}. so I have chosenShow to be the item the user picks from seriesResultsNames. Then I need to find out which one of the lists in seriesResults chosenShow is from so I can get item 1 of that list. So say user picks “five”, I want to match that up to item 2 of seriesResults and then get item 1 of item 2 of seriesResults, which is “four”. This is what I am trying to do with the repeat loop, with seriesCount being the number of items in seriesResults. But it does not seem to work and after it runs showID is always empty. What am I missing here? Or if there is a better way to match the answer up to a item in seriesResults let me know. Thanks in advance.