In article <isw-3018AE.09242005052008@[EMAIL PROTECTED]
>,
isw <isw@[EMAIL PROTECTED]
> wrote:
I had asked about suppressing the errors when I ran an AppleScript to do
some text replacements in TextWrangler.
After a lot of poking around and a couple of clues from the TextWrangler
mailing list, here's a snippet of a script that works. I thought others
might like to see the exact syntax required:
--
tell application "TextWrangler"
activate
try
replace " teaspoons " using " tsp. " searching in do***ent of text
window 1 options {case sensitive:true, returning results:false} without
saving
end try
try
replace " Teaspoons " using " tsp. " searching in do***ent of text
window 1 options {case sensitive:true, returning results:false} without
saving
end try
.... lather, rinse, repeat for all the other strings I want to change.
--
I never did figure out the proper syntax to get the "process lines
containing" verb to work, but now that all the errors are suppressed
(when a "replace" finds no target), I no longer need that list of "bait"
strings to guarantee a hit, and so I no longer need to find and delete
what remains of it after the script completes.
Thanks for the help; it encouraged me to keep looking for the answer.
Isaac


|