Skip to main content
Known Participant
June 28, 2024
Answered

Justify vertically Script

  • June 28, 2024
  • 2 replies
  • 419 views

I want to apply this option to tables that contain many cells via script. Can you give me an idea for the script?"

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer rob day

Hi @aghanjar16430960 , This would set all of the cells in your document to justify vertically:

app.documents[0].stories.everyItem().tables.everyItem().cells.everyItem().verticalJustification = VerticalJustification.JUSTIFY_ALIGN

 

2 replies

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
June 29, 2024

Hi @aghanjar16430960 , This would set all of the cells in your document to justify vertically:

app.documents[0].stories.everyItem().tables.everyItem().cells.everyItem().verticalJustification = VerticalJustification.JUSTIFY_ALIGN

 

James Gifford—NitroPress
Legend
June 29, 2024

I'm sure a script could be crafted, but the better approach/better basis for one would be to use Cell Styles that implement vertical justification. Just ripping through a doc applying the characteristic as an override is... no real advance.

 

That is, in all approaches I can think of, unless it's every cell in your doc, you have to select the cells anyway, and then apply or allow the script. Simply going through applying a cell style or two would take little longer and give you the doc structure to tweak the formatting instead of just running another bulldozer through it.