如何将AppleScript中用户输入的句子转换为每个单词的单独变量。例如,Lorem ipsum dolor sit amet
将被空格拆分为不同的变量,例如。 var1 = lorem, var2 = ipsum
等等。以下是我到目前为止所提出的内容,但我显然无处可去。
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
答案 0 :(得分:4)
只需使用'字'关键词。以下是脚本的一个小例子:
create table Cast (
^