On Jan 17, 2011, at 17:50, Robert Poland wrote: Looks like we're fighting the wrong battle. I think the issue is that the line "set AppleScript's text item delimiters to newDelimiter" won't work with a variable is place of text. ______________________________________________________________________
Hey Bob,
Well crap. I knew I should have hung onto your original post, and I can't refer to it now. But...
In the first post you made about this the first line was:
my setDelimiters(originalDelimiters)
I put your whole script into Script Debugger and started stepping through it. It balked on that first line - because you had not assigned 'originalDelimiters' a value before you make the handler call.
There is no problem setting TIDS via a variable, but the variable must have something in it.
on FIND_REPLACE(findText, replaceText, srcText) set oldTIDS to AppleScript's text item delimiters set AppleScript's text item delimiters to findText set srcText to text items of srcText set AppleScript's text item delimiters to replaceText set srcText to srcText as text end FIND_REPLACE
set someText to "Now is the time for all good men to come to the aid of their country."
set findText to "the" set replaceText to "•"
FIND_REPLACE(findText, replaceText, someText)
|