The code I have below only opens up the .txt file called numbers on the desktop. I need to change it so it will allow me to open any document.
Code: Select all
global fileChoice
global listOfNumbers
global n
global numbers
on mouseUp
   readInData
   putDataInArray
   displaydata
end mouseUp
on readInData
      open file specialFolderPath("Desktop") & "/numbers.txt" for read
      read from file specialFolderPath("Desktop") & "/numbers.txt" until eof
      put it into listOfNumbers
      read from file file until eof
   close file fileChoice
   end if
end readInData
on putDataInArray
   local i // integer
   put the number of words in listOfNumbers into n
   repeat with i= 1 to n
      put word i of listOfNumbers into numbers[i]
   end repeat
end putDataInArray
displayData



