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

Number Populate in text boxes

New Here ,
Feb 02, 2023 Feb 02, 2023

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
4.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

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

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

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!

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

If you press SHIFT - you'll get squares 😉

 

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

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

 

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

 

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

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.

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

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.

 

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

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

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)?

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

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.

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

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');
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
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

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

Nice! I learned something! 🙂

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

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

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