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

Number Populate in text boxes

New Here ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

I am trying to duplicate a singular text box and have a more straightforward way to have each text box's text be a number that is sequential. 

 

I just want about 96 text boxes to go from 1-96.  I obviously can do this manually, but I have to think there might be a secret trick to this.

 

Thanks,

Matt

TOPICS
How to , Scripting , Type

Views

1.4K

Translate

Translate

Report

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

Guide , Feb 03, 2023 Feb 03, 2023

It's just an InDesign feature that exists since 20 years!

 

Capture d’écran 2023-02-03 à 09.56.26.png

 

(^/)  The Jedi

Votes

Translate

Translate
Community Expert ,
Feb 04, 2023 Feb 04, 2023

Copy link to clipboard

Copied


click and drag a large text box

Okay David, my bad, I got it to work. I was dragging a text box (with the selection tool). For anyone else who read David's instructions wrong: click and drag, and press arrows, while drawing a text box. Thanks again for the tip!

Votes

Translate

Translate

Report

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 ,
Feb 05, 2023 Feb 05, 2023

Copy link to clipboard

Copied

LATEST

If you press SHIFT - you'll get squares 😉

 

Votes

Translate

Translate

Report

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 ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

Same page or separate pages - one box per page ?? 😉

 

If multiple TextFrames on the same page - @Creamer Training already gave you the correct answer.

 

Votes

Translate

Translate

Report

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
New Here ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

Currrently to test, one page/spread.  Just did a quick array with about 12 frames.  All are starting with the numbering, all say "1." in the frame.

 

Tried what he said but that's what I am getting.  Probably an error on my part but not sure what.

Votes

Translate

Translate

Report

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 ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

My idea was to use Page Numbering 😉

 

But if you have more than one TF per page - or one per page - you need to make a Story - thread all those TFs together - so the text flows between TFs.

 

Votes

Translate

Translate

Report

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 ,
Feb 05, 2023 Feb 05, 2023

Copy link to clipboard

Copied

Sorry if I wasn't clear. Sometimes my clarity depends on how much coffee I've had!

David Creamer: Community Expert (ACI and ACE 1995-2023)

Votes

Translate

Translate

Report

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
Contributor ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

Are you placing the text frames one or more than one per page? What do the numbers mean (that is, are they page numbers, section numbers, item numbers, or something else)?

Votes

Translate

Translate

Report

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
New Here ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

Yes all on one page. Goofy to explain. Let's for simplicity say they are dimensions. Want 1', 2', 3', 4' etc each in their own respective text box.

 

I'm away from my desk now but will play with it more tomorrow.

Votes

Translate

Translate

Report

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 ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

Hi @mattg2, since you tagged scripting, here is a general-purpose script that simply adds sequential numbers to selected text frames (it will ignore other types of items). Note that the layer order of the text frames will dictate the order of the serial numbers. To use it, just select some text frames and run script. It will ask which number to start with.

- Mark

 

/**
 * Will replace selected text frames' contents
 * with a serial number, entered by user.
 * @discussion https://community.adobe.com/t5/indesign-discussions/number-populate-in-text-boxes/m-p/13549934
 * @author m1b
 */
function main() {

    var startNumber = prompt('Number selected items:\nEnter starting serial number', '1');

    if (
        startNumber == null
        || isNaN(startNumber)
    )
        return;

    replaceItemContentsWithSerialNumber(app.activeDocument.selection, startNumber);


    /**
     * Replace contents of items with a
     * serial number starting at `startNumber`.
     * @param {*} items - array or collection of Page Items
     * @param {*} startNumber 
     */
    function replaceItemContentsWithSerialNumber(items, startNumber) {

        startNumber = Number(startNumber);

        if (isNaN(startNumber))
            startNumber = 1;

        for (var i = 0; i < items.length; i++)
            if (items[i].hasOwnProperty('contents'))
                items[i].contents = String(startNumber++);

    };

}

app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, 'Add serial numbers');

Votes

Translate

Translate

Report

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
Guide ,
Feb 03, 2023 Feb 03, 2023

Copy link to clipboard

Copied

It's just an InDesign feature that exists since 20 years!

 

Capture d’écran 2023-02-03 à 09.56.26.png

 

(^/)  The Jedi

Votes

Translate

Translate

Report

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 ,
Feb 03, 2023 Feb 03, 2023

Copy link to clipboard

Copied

Nice! I learned something! 🙂

Votes

Translate

Translate

Report

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
New Here ,
Feb 03, 2023 Feb 03, 2023

Copy link to clipboard

Copied

Awesome thanks, a screenshot is worth a thousand words.

 

I had in my list "Continue Numbers from Previous Document in book" checked.  That kept giving me 1, 1, 1, 1, etc.  Once I toggled that it worked like above.

 

Thank you

 

Matt

Votes

Translate

Translate

Report

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