Is anyone aware of a macro that will select the entire word by simply having the cursor placed somehwhere within that word?
This would make text editing a whole lot easier.
Thanks
Selecting a Single Word
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Selecting a Single Word
If you double-click any bit of text, the selection will expand to include the whole word that was clicked.
However, if you'd like to use a macro, here's one:
That uses a bit of magic (Cocoa's "selectWord:" selector), and I was hoping for a more reusable example, but strangely our macro language is missing a "rangeOfWordAtIndex" command, which would be the most straightforward.
Here's another macro that also selects the whole word. It uses regular expressions, which may or may not be clearer for you:
However, if you'd like to use a macro, here's one:
Code: Select all
Send Selector ‘selectWord:’
Here's another macro that also selects the whole word. It uses regular expressions, which may or may not be clearer for you:
Code: Select all
Find Previous '\b', 'E'
Find Next '\w+', 'E'
Re: Selecting a Single Word
Thanks Martin.
As usual you came through with just what I needed.
This tip will be used by me many thousands of time in the coming years!
Bill
As usual you came through with just what I needed.
This tip will be used by me many thousands of time in the coming years!
Bill