A Script for Cleaning Up Empty Text Frames

This is a guest post from a longtime reader, Masood Ahmad.

In my work, I often receive InDesign files containing several empty text frames created unknowingly by another user. As most of you know, double-clicking a frame with the Type tool converts that frame into a text frame. This can lead to problems like missing font warnings when (nearly) empty text frames contain one or more non-printing characters like spaces.

To get rid of these unwanted text frames, I used to manually search and convert them into unassigned frames (Object > Content > Unassigned). But I also remembered reading about a script that could do the job faster and easier. So I searched and found an article here at InDesignSecrets about Finding Empty Text Frames. The article include the script DeleteEmptyFrame.jsx by Harbs at InTools.

This was great, but it did some things that I didn’t want, like deleting empty text frames with fill colors or strokes. In my documents, empty frames with fills or strokes were template items, so I didn’t want them to be deleted. Also, this script wouldn’t remove frames containing just spaces.

Digging deep into the problem, I found a thread on the Adobe InDesign user forum about a script to convert empty text frames to unassigned frames. And at the end of the forum, I found some more information about using Find/Change to remove spaces. So I tried editing the script (though I’m not a script writer) and it worked!

Since I know many of us face this kind of issue, I thought of sharing it with you all. This script, called EmptyTextFramesRemoverAndConverter.jsx, will delete all text frames in a document with no stroke, no fill, and no text wrap if they are completely empty or if they contain just white space. It will delete them even if they are hidden (using Object > Hide), anchored, or pasted into other frames. It will not delete frames on hidden or locked layers, or frames that are grouped with other objects. Frames that are retained are converted from text frames to unassigned frames.

Before

IDS_20140609-empty1

After

IDS_20140609-empty3

Bookmark
Please login to bookmark Close

This article was last modified on December 30, 2021

Comments (6)

Leave a Reply

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

Loading comments...