Action to select/highlight 1- a word? 2- the line on which the cursor is located?

is there an action to select/highlight

1- a word?

2- the line on which the cursor is located?

thanks very much

As far as I know there are no built-in actions just for these purposes, but in most Mac apps (i.e. ones that use standard key bindings) I believe you can accomplish these goals through basic keystroke simulations:

Select Word.kmmacros (1.4 KB)

Select Line.kmmacros (1.4 KB)

Of course, since these macros just simulate keystrokes, they are very unlikely to work 100% of the time in all apps, but they should be enough in most situations (though you may want to edit the "Select Word" one to use โŒฅโ†’ followed by โ‡งโŒฅโ† if you would rather select the word to the right of the cursor rather than to the left in cases where the cursor is in between two words).

If I may ask, what app(s) do you primarily plan to use these macros in, and what's the ultimate goal you're trying to accomplish with them? The more details you can provide, the better we should be able to help (as an example, if you mean to use these primarily in, say, BBEdit, there are much more precise options using AppleScript for achieving these same actions).

2 Likes

thank you very much !

1 Like