Transpose two characters
Keith whips up a cool script to swap the order of two characters.
I was editing a large file yesterday, and repeatedly needed to move periods from outside closing quotes to the inside. I like to use drag and drop text editing for moving text around, but trying to select and then drag and drop a single character is infuriating.
InCopy has a cool “Transpose” command that will change the order of the characters on either side of the cursor. But alas, InDesign has no such command.
So I whipped up a quick script called TransposeTwoCharacters that does just that: It will swap the order of the characters to the right and left of the insertion point. Just put your cursor between two characters that need to be swapped, and double-click on the script in the Scripts panel. Even better, use the Keyboard Shortcut Editor to assign a keyboard shortcut to the script so that you can transpose characters with a simple keystroke.
This article was last modified on December 20, 2021
This article was first published on June 8, 2010
Commenting is easier and faster when you're logged in!
Recommended for you
JavaScript for the Absolute Beginner
You know you want to learn how to script InDesign, but you don't know where to s...
How to Set Up Caption Frames to Auto-Size in InDesign
Learn how to make caption frames consistent—especially in relation to the images...
Store Live Captions in libraries
Learn a handy way to create repetitive Live Captions in InDesign CS5 easily, plu...
