I am working on ascript to do the following:
1. Set the first Row of all tables in my doc to these settings:
2. Set rest of the cells to these settings:
Here is where I am at:
app.activeDocument.stories.everyItem().tables.everyItem().rows[0].heig ht = ".25 in";
app.activeDocument.stories.everyItem().tables.everyItem().rows[0].topI nset = ".04 in";
app.activeDocument.stories.everyItem().tables.everyItem().rows[0].bott omInset = ".04 in";
for( x = 1; x < app.activeDocument.stories.everyItem().tables.everyItem().rows.length ; x++ ) {
app.activeDocument.stories.everyItem().tables.everyItem().rows[x].heig ht = ".12 in";
}
for( x = 1; x < app.activeDocument.stories.everyItem().tables.everyItem().rows.topIns et; x++ ) {
app.activeDocument.stories.everyItem().tables.everyItem().rows[x].topI nset = ".12 in";
}
for( x = 1; x < app.activeDocument.stories.everyItem().tables.everyItem().rows.bottom Inset; x++ ) {
app.activeDocument.stories.everyItem().tables.everyItem().rows[x].bott omInset = ".12 in";
}
I keep getting this error and I am stuck.
Anyone see anything that would help?
Thanks in advance.
There is indeed an extra closing parentheses on that line in the screenshot (but not in your sample lines).
I wonder if this construction
for( x = 1; x < app.activeDocument.stories.everyItem().tables.everyItem().rows.length ; x++ ) {
app.activeDocument.stories.everyItem().tables.everyItem().rows[x].heig ht = ".12 in";
}
every could work ... The for..loop expects a simple end number, but you feed it with an array of all of your individual tables' row lengths.
If this indeed does not work, turn your script around. Set all of the row heights and insets using
app.activeDocument.stories.everyItem().tables.everyItem().rows.everyItem().topInset = ".12 in";
and after that run the lines to do the top row adjustments.
(Use "Advanced editor" to be able to set Javascript syntax highlighting -- it makes your code ever so slightly more readable.)
Ahh... Good catch. Forgive me.
Let me start again with my goals:
1. Set the first Row of all tables in my doc to these settings:
2. Set rest of the cells to these settings:
That's it. So simple. Thank you so much for your help.
app.activeDocument.stories.everyItem().tables.everyItem().rows.everyIt em().height = ".12 in";
app.activeDocument.stories.everyItem().tables.everyItem().rows.everyIt em().topInset = ".012 in";
app.activeDocument.stories.everyItem().tables.everyItem().rows.everyIt em().bottomInset = ".012 in";
app.activeDocument.stories.everyItem().tables.everyItem().rows[0].heig ht = ".25 in";
app.activeDocument.stories.everyItem().tables.everyItem().rows[0].topI nset = ".04 in";
app.activeDocument.stories.everyItem().tables.everyItem().rows[0].bott omInset = ".04 in";
North America
Europe, Middle East and Africa
Asia Pacific