Copy link to clipboard
Copied
I'm making a diagram of pattern peices that must be placed down in a numbered order, and often need to add a peice or redo the order of placement. and every time I have to re number the entire file. I have to click on every single text box and manually change everything. Is there a way to make it so that when one value on an artboard changes, the rest do in turn, like in Excel? Or a way to link excel and Illustraor?
I personally use Illustrator but if this is possible for any of the Creative Suite programs, I'll happily switch over to another program once I am at the numbering stage.
Thanks in advance!
Copy link to clipboard
Copied
You might want to try importing the Illustrator art into InDesign and using threaded text frames in that program for the numbers. To learn how to do this see: https://helpx.adobe.com/lu_en/indesign/using/threading-text.html.
Copy link to clipboard
Copied
Each time this is run, it will increase every number by one.
var doc = app.activeDocument;
var frames = doc.textFrames;
for (var i = 0; i < frames.length; i++) {
frames[i].contents = Number(frames[i].contents) + 1;
}
Copy link to clipboard
Copied
Alternatively, this will increase every number higher than the selected number by one.
var frames = app.activeDocument.textFrames;
var x = 0;
for (var i = 0; i < frames.length; i++) {
if (selection[0] == frames[i]) {
x = i;
break;
}
}
for (var i = 0; i < frames.length; i++) {
if ((Number(frames[i].contents) >= Number(frames[x].contents)) &&
frames[i] != frames[x]) {
frames[i].contents = Number(frames[i].contents) + 1;
}
}