Tables - Row Height and Cell Insets
i working on ascript following:
1. set first row of tables in doc these settings:
- row height = .25in
- top , bottom inset = .04in
2. set rest of cells these settings:
- row height = .12in
- top , bottom inset = .12in
here at:
app.activedocument.stories.everyitem().tables.everyitem().rows[0].height = ".25 in";
app.activedocument.stories.everyitem().tables.everyitem().rows[0].topinset = ".04 in";
app.activedocument.stories.everyitem().tables.everyitem().rows[0].bottominset = ".04 in";
for( x = 1; x < app.activedocument.stories.everyitem().tables.everyitem().rows.length; x++ ) {
app.activedocument.stories.everyitem().tables.everyitem().rows[x].height = ".12 in";
}
for( x = 1; x < app.activedocument.stories.everyitem().tables.everyitem().rows.topinset; x++ ) {
app.activedocument.stories.everyitem().tables.everyitem().rows[x].topinset = ".12 in";
}
for( x = 1; x < app.activedocument.stories.everyitem().tables.everyitem().rows.bottominset; x++ ) {
app.activedocument.stories.everyitem().tables.everyitem().rows[x].bottominset = ".12 in";
}
i keep getting error , stuck.
anyone see help?
thanks in advance.
there indeed closing parentheses on line in screenshot (but not in sample lines).
i wonder if 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 work ... for..loop expects simple end number, feed array of of individual tables' row lengths.
if indeed not work, turn script around. set of row heights , insets using
app.activedocument.stories.everyitem().tables.everyitem().rows.everyitem().topinset = ".12 in";
and after run lines top row adjustments.
(use "advanced editor" able set javascript syntax highlighting -- makes code ever more readable.)
More discussions in InDesign Scripting
adobe

Comments
Post a Comment