Clean Up Spurious White Space

The script removes leading, trailing, and duplicate white space. Optionally change all caps to sentence case.

This script is part of the Type and Text collection. See the full collection here.ย 

The script removes spurious white space (multiple returns, tabs, spaces). With nothing selected, the script processes the whole active document; with some text frame(s) or text selected, only that selection is dealt with.You can optionally replace all caps with sentence case: just tick the checkbox in the script’s interface.

clean script screenshot

Press OK or Enter/Return to run the script.


Peter Kahrel Script Repository
Hosted as a community service, and with deep appreciation, by CreativePro.com


Scripts by Topic | Script Index
Basic Script Installation and Use
How to Modify or Configure These Scripts
Resources for Scripting and Publishing Automation
About This Repository


Repository Home Page


Contact Peter Kahrel


Note to users: You run scripts at your own risk: CreativePro and the author accept no liability for anything that may be caused by any of these scripts. Always take the necessary precautions. We encourage you to save backups and test scripts on copies of your documents.

Bookmark
Please login to bookmark Close

This article was last modified on August 22, 2026

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

Loading comments...