Macro of the Month – August 2023 – SwapPunctuation
Swaps adjacent punctuation marks, such as a period or a comma with a quotation mark
Welcome to the August newsletter, where this month’s macro speeds up correcting adjacent punctuation marks that are in the wrong order. And also a nudge to back up your macros.
SwapPunctuation
Sometimes two adjacent punctuation marks need to be swapped. This occurs most commonly between a closing quote and a comma or period. Applying the correct convention requires you to delete one mark and retype it in the correct place, a fiddly task that demands precision with your mouse placement. Or let SwapPunctuation do the work for you.
How it works: SwapPunctuation flips the order of two punctuation marks: a comma and a closing quote, a period and a closing quote, and even a question mark or exclamation point and a closing quote. Whatever order they are in, SwapPunctuation does the swapping for you.
How to use it: When you come upon two punctuation marks that need to trade places, run SwapPunctuation. To make this edit even more efficient, the macro is designed to scan ahead looking for two adjacent punctuation marks, saving you the time and effort of having to move the cursor to the correct spot. In other words, the cursor can be standing three, four, or more words to the left of the errant punctuation pair and the macro will work.
In both examples, the cursor is standing many words to the left of the punctuation pair that need to be swapped. SwapPunctuation scans ahead looking for adjoining marks and then swaps their placement, whether the convention you are following requires the punctuation to stand inside or outside the closing quote.
Download the code: www.wordmacrotools.com/macros/S/SwapPunctuation
Related macros: You can also correct this error globally using FRedit. Your FRedit list entries would be:
Moving a period outside a single closing quote: .’|’.
Moving a comma outside a single closing quote: ,’|’,
Moving a period inside a double closing quote: ”.|.”
Moving a comma inside a double closing quote: ”,|,”
If you are not a FRedit user, you can learn to use it through the free FRedit from Square One self-tutoring guide.
When was the last time you backed up your macros?
We don’t always want to pause to take care of this housekeeping chore, but we really should. In the macro classes and workshops I’ve taught over the past few months, one of the common threads was people’s macros disappearing. It’s happened to me twice since June. When Word updates or crashes, or is just being its normal glitchy, mysterious self, your macros can disappear. Having a backup of your macros will save you from a headache.
Here are two ways to back up your macros, listed from low-tech to medium-tech:
For instructions on how to manually back up your macros, check out the September 2021 newsletter. Note: This will not back up your keyboard shortcuts.
To back up your Normal template, which will back up your macros and your shortcuts, refer to this instruction sheet hosted on Paul Beverley’s website.
What repetitive editing task do you wish you had a macro for? Reply to this email and let me know.
Regards,
Jennifer