I made the the typographic_grid_wizard script in annex. The python script is working, but I have the following questions:1) In line 100 I use the command scribus.setMargins(). It updates the margin values on the active page, but does not change the displayed margin guides on that page (only after manually clicking 'Apply changes to all pages' in the Document Setup-menu it changes). Can this be done by scripting or have I missed something (I am a beginner in programming)?2) Is there a way to perform the menu command View -> Text frames -> Show baseline grid by scripting?

After some other testing I found a mistake in my script (nothing to do with my question above):line 87 shoud be "previousGuide = marginLeft*columnUnitPt" in stead of "previousGuide = marginTop*columnUnitPt".

i have not touched it for some times now, and i don't know if it really works. but, at the end, you will see some notes that hint to the fact that it's not possible yet to create row and column guides from the scripter.

3.

i have a newer script i wrote more recently, and which runs outside of scribus

- it does not use (yet) the scribus scripter. plain python. - it needs to know - the size inside of the margins - the number of rows - the baseline height you'd like to have - the result is two values for for the baseline height: one bigger and one smaller than the one given by the user. - the goal is to extend the scripter to allow the script to run without asking (almost) any question to the user. - i'll paste the script in a further post in here, since it's not published yet.

4.

now, i'll try to understand the script you've submitted : - )

- it has a rather complex tcl/tk UI - it can remove the current guides - it asks for the margins - it asks for the number of rows and columns - it asks for the h and v gutter - it asks for a desired line height and cell ratio- it suggests to modify by a calculated value the top/bottom or inner/outer margins if it cannot fit the lines in the rows.- it everything fits, it creates multiple single guides

in a follow up i'll have a look at your line 100... but the anser to 2/ is "probably no"...

high_measurements = get_measurements(high, page)print('smaller lines', high_measurements)low_measurements = get_measurements(low, page)print('larger lines', low_measurements)i think it would be good to enhance to suggest margin changes. on the other side, i'm not sure that using the ratio is a practical idea... i have the feeling that most people have a clear idea of how many rows and columns they want...

Thank you for taking the time to review my script and answering my questions!It seems more people are trying to get a typographic grid script within Scribus, all with different methods, and mine is a complicated one. I will wait for the setPageMargins() function to be added to the scripter api to publish a new version (and also think about the necessity of the ratio).

One last question: When I do several "recalculations", the tkinter window hangs. Could this be a program or a memory issue? (I am using Windows 10 and Scribus portable 1.5.4).

I have adapted my script with the remarks of the posts above and want to share it. Now it works fine for me (with the python version 2.7 which was bundled with my Scribus version). A guide with an example of how to use this script is included in the zip file.