How would I turn a sentence entered by a user in AppleScript into separate variables for each word. For example, Lorem ipsum dolor sit amet would be split by the space into different variables, Ex. var1 = lorem, var2 = ipsum and so on. Below is what I've come up with so far, but I'm clearly getting nowhere.
set TestString to "1-2-3-5-8-13-21"
set myArray to my theSplit(TestString, "-")
on theSplit(theString, theDelimiter)
-- save delimiters to restore old settings
set oldDelimiters to AppleScript's text item delimiters
-- set delimiters to delimiter to be used
set AppleScript's text item delimiters to theDelimiter
-- create the array
set theArray to every text item of theString
-- restore the old setting
set AppleScript's text item delimiters to oldDelimiters
-- return the result
return theArray
end theSplit