Re: applescript-users digest, Vol 2 #766 - 16 msgs
Re: applescript-users digest, Vol 2 #766 - 16 msgs
- Subject: Re: applescript-users digest, Vol 2 #766 - 16 msgs
- From: email@hidden
- Date: Sat, 16 Jun 2001 05:33:35 EDT
>
I'm trying to create a script which will take a (very long... probably too
>
long for Applescript's memory buffer) list of items in Microsoft Word,
>
and eliminate those which are shorter than 4 characters or longer than 9.
Each
>
item is separated by a carriage return, and I'd like to eliminate the
>
carriage returns along with the deleted item, so that I'm left with a neat
>
list with no vertical spaces between items.
Thanks everyone, for your help, and Paul, for the suggestion of Tex-Edit
Plus. A great program, with awesome Applescript support. MS Word is now
unneccessary (whew!) Here's a short script which works:
tell application "Tex-Edit Plus"
delete (every word in window 1 where (length of it is less than 4))
end tell
Two problems which I'm having, though, are: 1. I can't seem to figure out how
to eliminate the carriage returns which go with the deleted words. (The doc
contains a list of words, each followed by a carriage return - this script
eliminates the word, but leaves a blank space between the surrounding items
in the list). 2. This script works on up to a certain length list. Beyond
that, the script hangs up, I have to force quit Tex-Edit, and Applescript
gives me a "timed out" error message. Are there any work arounds, or will I
have to do my lists in smaller chunks?
Again, thanks all.
Andy D