I would use the Replace All command

Re: Comma placement -- Brit
Posted by Emmanuel , 05/13/2022, 02:45:40 Reply Top of Thread Forum

I would use the Replace All Selection Command to replace all spaces in the selected text by a comma followed by a space:

wholeWord = "n"
matchCase = "n"
preserveCase = "n"
findWhat = " "
replaceWith = ", "

The gimme_time_to_select snippet before the ReplaceAll command is there to enable you to select the list of words you want to separate with commas. Once you have selected it using the mouse or the universal keyboard shortcuts, you just press the Resume Hotkey F8 to trigger the replacement.

Note that this technique using the gimme_time_to_select snippet can be reused for various commands which apply to selected text.

If you do not use this technique, your sole option to trigger an expansion that modifies already selected text is to use a Hotkey. Typing a short when the text is already selected is NOT possible as it will override the selected text.

Edit | Reply | | Original Message | Top of Thread | Current page | Author