Skip to main content
Inspiring
November 23, 2011
Answered

Setting Baseline and Document Grid

  • November 23, 2011
  • 2 replies
  • 3956 views

I have an idea for an InDesign script which I think would be nice to utilize. I have gathered a lot of the recommended stuff to read how to make such scripts but it will take a lot of time for me to get to the point of making this script. I am now at the point of just passing the Hello World stage.

In the meantime I wonder if someone with more ability would like to and maybe have some fun solving this.

So far I have found in the documents a sniplet that works as the end of the script but it has to get some additional info to work in the way I want. Here is the script, taken from one of Adobe's JavaScript tutorials:

var myDocument = app.activeDocument;

//Set the document measurement units to points.

myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;

myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

//Set up grid preferences.

with(myDocument.gridPreferences){

baselineStart = 0;

baselineDivision = 11.225;

baselineShown = true;

horizontalGridlineDivision = 11.232;

horizontalGridSubdivision = 1

verticalGridlineDivision = 11.225;

verticalGridSubdivision = 1

documentGridShown = true;

}

I put in different numbers from what was in that example and that is exactly what I need the script to do.

What needs to before this part is excecuted is:

1. The script gets the document size, W and H

2. The script opens up a dialog box where the user put in the font leading (L) he wants to use for the baselineDivision. Let's say 11.2pt. Click OK.

     I think baselineStart and vertical and horizontalGridlineSubdivision should be as they are here.

3. The script now calculates:

     H/L=R. Rounds off the digits of the result (R) to a whole number and calculates: H/R=VGD (verticalGridlineDivision, same as is used for baselineDivision)

     W/L=R. Rounds off the digits of the result (R) to a whole number and calculates: W/R=HGD (horizontalGridlineDivision)

     and puts the results into the script above which then is excecuted and sets both Baseline Grid and Horizontal and Vertical values for the Document grid.

4. An added bonus would be a display window that would display the number of gridlinedivisions W and H.

The point of all this is to set up a Baseline Grid that is evenly distributed all over he page, not leaving half line at the bottom and such. At the same time it calculates Document Grid the same way and it is made up of squares that are almost 1:1 Less than .1% away.

The last display window would help to calculate columns and rows in a grid but this is also a starting point into another script.

Any help to a newcomer welcomed.

This topic has been closed for replies.
Correct answer

Hi Sigurdur, we’ve recently released Fitbaseline to the public​: it’s an InDesign script we’ve developed and use to distribute the baseline grid over the document height, plus some extra’s. You might be interested to check it out: fitbaseline.com

2 replies

Participating Frequently
February 6, 2019

Hi Sigurdur we do have a plugin to evenly distribute the baseline to the page, it does even more it is a complete tool to create layout grids. You can find it at www.layoutgridcalculator.com/plug-in/. There is another plugin by Designers Bookshop called Grid Calculator Pro which does essentially the same thing. But the difference is that www.layoutgridcalculator.com/plug-in/ is more than a calculator, it's a tool that contains interesting features like the Chromatic Scale selector and so on. It works in a way that it will help you create beautiful and harmonious layouts. It has a very user-friendly user interface. Alternatively you can us the free online version  www.layoutgridcalculator.com

Inspiring
February 19, 2019

Thank you Jean. I have already pre-ordered your plug-in. Excited to try it out.

I already have the Fitbaseline tool, some scipts I have collected too and TGE Grid Calculator. On top of that I have made my own calculations tables online found here:

https://font.is/grid-systems/

https://font.is/EasyGridCalculatorProportional/EasyGridCalculatorProportional.htm

Participating Frequently
February 20, 2019

Oh, great thanks!

Correct answer
May 15, 2017

Hi Sigurdur, we’ve recently released Fitbaseline to the public​: it’s an InDesign script we’ve developed and use to distribute the baseline grid over the document height, plus some extra’s. You might be interested to check it out: fitbaseline.com

Inspiring
May 15, 2017

Thanks for replying. fitbaseline.com is nice. This is part of what I was searching for.

I posted this question in 2011. Sometimes in between I made a calculator for this. Not only for the baseline, but for splitting the whole page into units, either as squares or proportional. Check it out

font.is » Grid Systems

EasyGridCalculatorSquare

May 15, 2017

Thank you, that’s good to hear. I will put Easy Grid Calculator into practice, experiment a bit and let you know what I think. It’s an interesting and extensive approach.