You have a text frame of a given width (for example 277 mm) and you want to split it to several columns (of equal width) separated by gutters, you can do it easily in the "Text Frame Options" dialog.
- If you want 2, 4, 5 or 8 columns, you will easily get column and gutter widths multiples of 0.25 or 0.1 by selecting "Columns: Fixed Number", by changing the "Number" and "Gutter" fields without touching the "Width" field (ex: 5 columns, gutters 4 mm → width 52.2 mm).
- But for other numbers of columns such as 3, 6, 7, 9, 11… You will get unpleasant values (ex: 7 columns, gutters 4 mm → width 36.143 mm).
This script will enable you in the second case to find simpler values: you select your text frame and launch the script, and it will suggest you all possible column and gutter widths multiples of a given increment (by default, the cursor key increment of your document view preferences). This enables you to discover round values you'd never thought about: for example you can split your 277 mm text frame to seven 37 mm columns separated by 3 mm gutters.
You may also, to fix the layout of a document, use first this script on a text frame to calculate column and gutters values that you will then copy to the "Margin and columns" settings of your page.