I have the following function that does string splitting:
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
When used by itself, it works ok
log splitText(“http://google.com|/Users/pistacchio/Desktop/google.jpg”, “|”)
But when I use it within the context I need, I get a -1708 error
tell application "Safari"
activate
repeat with row in linesToPrint
log splitText("http://google.com|/Users/pistacchio/Desktop/google.jpg", "|")
end repeat
end tell
linesToPrint is an array of strings
Any help?
When using a handler from inside an application tell statement, you need to use the terms of me or my to indicate that the term is from your script, and not something that the application needs to do.