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
Book Excerpt: JavaScript for InDesign
Don’t wait for Adobe to create the features you want in InDesign—make them yours...
CreativePro Week 2026 Preview: 5 Indispensable InDesign Sessions
Five sessions InDesign users can't afford to miss
Database publishing, a lean approach with Pagination.com
Article presented by If you have dealt with data publishing projects, as I do, y...
