It might help to note that an array is an enumerable and that enumerable
gives you each_slice. So if you really mean a word and the 3 words on
either side of it, that's 7 words - and so if you take slices of 7
elements, you can examine each one to see if its middle item is your
word. m.

Rory Pascua <rorypascua / yahoo.com> wrote:

> I'm trying to take a long piece of text, find a word, and get that word
> and the 3 words on either side of it and put that new "string" into
> another variable.

-- 
matt neuburg, phd = matt / tidbits.com <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings