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
How to Set Up Caption Frames to Auto-Size in InDesign
Learn how to make caption frames consistent—especially in relation to the images...
Now available: JavaScript for InDesign, 2nd Edition
Learn how to harness the power of scripting in InDesign. And take advantage of a...
Exchange or Swap Two Images with this Free InDesign Script
You have two images that you want to exchange or swap*. The first question is do...
