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
It's just an InDesign feature that exists since 20 years!
(^/) The Jedi
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!
Copy link to clipboard
Copied
If you press SHIFT - you'll get squares 😉
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.
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.
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.
Copy link to clipboard
Copied
Sorry if I wasn't clear. Sometimes my clarity depends on how much coffee I've had!
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)?
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.
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');
Copy link to clipboard
Copied
It's just an InDesign feature that exists since 20 years!
(^/) The Jedi
Copy link to clipboard
Copied
Nice! I learned something! 🙂
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