Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Is there a way to delete all my overset text at once?

Community Beginner ,
May 31, 2023 May 31, 2023

As mentioned above, i have a huge document with multiple overset (and unwanted) text all around, i want to clean it up and dont want to go one by one.... maybe a script? Thank you !!

TOPICS
How-to , Scripting , Tools , Type
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 01, 2023 Jun 01, 2023

Okay @Lalo Mc. Fly, after accidentally writing the script for Indesign (*facepalm*) here is my attempt at the same script for Illustrator. Let me know if any bugs, and ideally post a sample document that shows the bug.

- Mark

 

 

/**
 * Remove All Overset Text In Active Document For Illustrator
 * @author m1b
 * @discussion https://community.adobe.com/t5/illustrator-discussions/is-there-a-way-to-delete-all-my-overset-text-at-once/m-p/13832918
 */
(function () {

    var doc = app.activeDocument,
...
Translate
Adobe
Community Expert ,
May 31, 2023 May 31, 2023

EDIT: Sorry! On my phone I couldn't see which forum this was posted in and I assumed it was Indesign. Please ignore this answer because it is a script for Indesign.

 

Hi @Lalo Mc. Fly, here's a script that should do this. I just wrote it now, so it's quite untested, so have a careful look through your document after using it.

- Mark

 

 

 

/**
 * Remove All Overset Text In Active Document for Indesign
 * @author m1b
 * @discussion https://community.adobe.com/t5/illustrator-discussions/is-there-a-way-to-delete-all-my-overset-text-at-once/m-p/13832918
 */
function main() {

    var doc = app.activeDocument,
        stories = doc.stories.everyItem().getElements(),
        counter = 0;

    for (var i = stories.length - 1; i >= 0; i--) {

        if (stories[i].overflows == false)
            continue;

        var lastTextFrame = stories[i].textContainers[stories[i].textContainers.length - 1];
        var overFlowText = stories[i].characters.itemByRange(lastTextFrame.texts[0].insertionPoints[-1], stories[i].insertionPoints[-1]);

        if (overFlowText.isValid) {
            overFlowText.remove();
            counter++;
        }

    }

    alert('Removed ' + counter + ' overset texts.');

};

app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, 'Remove All Overset Text');

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 31, 2023 May 31, 2023

Hi Mark, is that script for InDesign?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 31, 2023 May 31, 2023

Oops! Haha. Yep, on my phone I didn't notice it was for Illustrator!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

Okay @Lalo Mc. Fly, after accidentally writing the script for Indesign (*facepalm*) here is my attempt at the same script for Illustrator. Let me know if any bugs, and ideally post a sample document that shows the bug.

- Mark

 

 

/**
 * Remove All Overset Text In Active Document For Illustrator
 * @author m1b
 * @discussion https://community.adobe.com/t5/illustrator-discussions/is-there-a-way-to-delete-all-my-overset-text-at-once/m-p/13832918
 */
(function () {

    var doc = app.activeDocument,
        stories = doc.stories,
        counter = 0;

    for (var i = stories.length - 1; i >= 0; i--) {

        var story = stories[i],
            lastTextFrame = story.textFrames[story.textFrames.length - 1];

        // point text can't be overset
        if (lastTextFrame.kind == TextType.POINTTEXT)
            continue;

        // make a temp frame to take the overset text, if any
        var temp = doc.textFrames.areaText(doc.pathItems.rectangle(0, 0, 3000, 3000));
        lastTextFrame.nextFrame = temp;
        var over = temp.characters;

        // remove the overset text
        if (over.length && counter++)
            for (var j = 0; j < over.length; j++)
                story.characters[story.characters.length - 1].remove();

        // clean up
        temp.remove();

    }

    alert('Removed ' + counter + ' overset texts.');

})();

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 01, 2023 Jun 01, 2023

Script works perfectly, thank you so much Mark !

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

You're welcome!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

It may also work by selecting all (area) type objects, converting them to point type objects in the Type menu (a warning message should appear then, informing that you are going to clear all overset text with that step) and then converting the point type objects back to area type objects.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

Cool approach Kurt! that would be super quick and convenient in most cases but if you have overset text on a path you may need my script.

- Mark

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

But, Kurt, that introduces soft returns at every line, so you also need some find/replace.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

Indeed, Mark. Thanks for reminding and sharing your script.

 

Thanks, Ton, for reminding as well.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 01, 2023 Jun 01, 2023
LATEST

good one!! thank you for sharing the technique

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines