Hi Chris,

I can offer no efficient solution but I can affirm that this is a very
handy functionality (if you ever tried the command viw in vim you know who
it feels :-)

In BBEdit I use two scripts for selecting words. The fist one is the same
Neil pointed to (from John Gruber).

The second one ignores punctuation. This is basically a recorded search
(backwards for \s than forward for \s extending selection). As your
Applescript capabilities are legendary and well known in this list (and
elsewhere), I’m sure that approach would well meet your „spaghetti“
definition. But on the other side, this dirty script *feels* fast enough
and I use it day in and day out.

Maybe BBEdit’s Select Menu will get a 'word' sibbling on some future day.
Till then it’s pasta for me ...

Roland


On Thu, Nov 30, 2017 at 10:28 PM, Christopher Stone <
listmeis...@suddenlink.net> wrote:

> Hey Folks,
>
> I'm trying to write some efficient AppleScript code to select the WORD the
> cursor is IN or next to (right or left).
>
> Examples would be having the cursor anywhere between the “>” & “<” symbols
> in the text below:
>
> ----------------------------------------------------------------
>
> >Now< is the time for all good men to come to the aid of their country
>
> >Supercalifragilisticexpialidocious< is obviously from “Mary Poppins” if
> you're of a certain age...
>
> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
> >tempor<
>
> ----------------------------------------------------------------
>
> I've got some spaghetti code I don't like at the moment and thought I'd
> ask before continuing to reinvent the wheel.
>
> TIA.
>
> --
> Best Regards,
> Chris
>
> --
> This is the BBEdit Talk public discussion group. If you have a
> feature request or would like to report a problem, please email
> "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
> ---
> You received this message because you are subscribed to the Google Groups
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to bbedit+unsubscr...@googlegroups.com.
> To post to this group, send email to bbedit@googlegroups.com.
> Visit this group at https://groups.google.com/group/bbedit.
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to