我有以下函数进行字符串拆分:
on splitText(aString, delimiter)
set retVal to {}
set prevDelimiter to AppleScript's text item delimiters
set AppleScript's text item delimiters to {delimiter}
set retVal to every text item of aString
set AppleScript's text item delimiters to prevDelimiter
return retVal
end splitText
单独使用时,它可以正常使用
log splitText(“http://google.com | /Users/pistacchio/Desktop/google.jpg”,“|”)
但是当我在我需要的上下文中使用它时,我收到-1708
错误
tell application "Safari"
activate
repeat with row in linesToPrint
log splitText("http://google.com|/Users/pistacchio/Desktop/google.jpg", "|")
end repeat
end tell
linesToPrint
是一个字符串数组
任何帮助?