Copy link to clipboard
Copied
Please, need a help with this script as we have hundred of tables.
And make a total substitution.
Thanks
That looks extremely easy to make with Table Styles. Have you used the Table Styles or Cell Styles panels at all?
... if the answer is "no" then all of your cells have No Style and your tables have Basic Table style applied. If you make a Cell Style with your horizontal borders only, and then a Table Style that specified your new Cell Style in the "Body" dropdown.
... if you do have some Table Styles in use, you might have to "Apply Table Style, Clear Overrides."
It's possible to do t
...Copy link to clipboard
Copied
Well, I mean deleting just the vertical ones to obtain something like this:
Thanks.
Copy link to clipboard
Copied
That looks extremely easy to make with Table Styles. Have you used the Table Styles or Cell Styles panels at all?
... if the answer is "no" then all of your cells have No Style and your tables have Basic Table style applied. If you make a Cell Style with your horizontal borders only, and then a Table Style that specified your new Cell Style in the "Body" dropdown.
... if you do have some Table Styles in use, you might have to "Apply Table Style, Clear Overrides."
It's possible to do this by directly applying Cell Styles, but it takes more clicks
It's possible to do this with scripting, by either automating the cell-border stuff, or by automating the application of table and cell styles with JS, but to be frank, I rarely encounter people using Table Styles at all, so when they say "Augh, how am I to do this to all of my hundreds of tables?" my typical response is "Well, all of your tables all share the Basic Table style, right? Because you haven't opened that panel since you were first learning ID, right?" and the answer has been 100% "You're right, Joel, I know where that panel is and I have never used it for anything."
(One day I will encounter another user of Table Styles - I mean, one that's not already a regular poster here - but I'm not holding my breath.)
Copy link to clipboard
Copied
No. This was not a correct answer.
And I am worried if someone has impersonated me on this forum because I did NOT mark the answer as correct.
1. Mr Chenney's answer is a solution but it is not correct for this case. I was looking for a script to chain it to others and do various formatting operations. What he proposes requires making adjustments to the menus that are not appropriate for what is required, which is to automate a process. Ergo,
2. There is a great free script by Eugenyus Budantsev that solves the request perfectly but it requires filling menus and therefore cannot be chained.
Ergo, a solution is not always a correct answer!
Copy link to clipboard
Copied
Joel,
anyway your answer was very good.
A perfect method to avoid using the insoportable cell styles.
I don't agree the idea of making overriding manouvers. A solution for this, it necessary, is use character styles before any total clean.
Best regard.
Thanks
Copy link to clipboard
Copied
Well, it is completely true that my answer doesn't specifically respond to your request for a script:
app.documents[0].stories.everyItem().tables.everyItem().cells.everyItem().properties =
{
topEdgeStrokeWeight : 1,
bottomEdgeStrokeWeight : 1,
leftEdgeStrokeWeight : 0,
rightEdgeStrokeWeight : 0
}
It's easy to add additional properties - including appliedCellStyle, if you want to go that way.
One of the things my Community Expert badge lets me do is mark answers correct, or remove correct marks, as appropriate. I imagine something similar has happened here; someone with some kind of moderator powers thought that this one was resolved, so they marked my response Correct. I've unmarked my previous answer, so you can come back and mark this answer as correct yourself.
Copy link to clipboard
Copied
Joel,
no doubt you deserve to be called a gentleman. justice is unfair.
i would like to give you a double correct answer but the moderators will surely agree.
Thanks a lot for those great lines of code. We have to wait for the pension to be able to study scripting...