Author Topic: How to Change Column Gap En Masse (Version 1.4.7)  (Read 875 times)

spibo

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
  • Scribus User
How to Change Column Gap En Masse (Version 1.4.7)
« on: March 26, 2019, 04:14:02 pm »
Hello,

Is there any way to change the column gap of multiple text frames at once?

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2176
  • Karma: 28
    • the graphics lab
Re: How to Change Column Gap En Masse (Version 1.4.7)
« Reply #1 on: March 27, 2019, 09:45:35 am »
no, i don't think so...

but if you have really many frames to modify, it would be easy to write a small script that goes through all frames and changes the column gap.

the pseudo code for it is:

for each page
  for each item in page
    set column gap to 1 cm

but you probably don't want to modify every frame in the document, so i have to know more about the to find the frames to be changed, before i can help you to create a python script for it...

spibo

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
  • Scribus User
Re: How to Change Column Gap En Masse (Version 1.4.7)
« Reply #2 on: March 28, 2019, 12:50:16 am »
Every text frame in the document is identical, I do indeed want to modify all of them in the same way.

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2176
  • Karma: 28
    • the graphics lab
Re: How to Change Column Gap En Masse (Version 1.4.7)
« Reply #3 on: March 28, 2019, 03:48:03 pm »
this script will do what you need:

Code: [Select]
import scribus

unit = scribus.getUnit()
scribus.setUnit(scribus.UNIT_MILLIMETERS)

columns_width = 20

for page in range(1, scribus.pageCount() + 1):
    scribus.gotoPage(page)
    for item in scribus.getPageItems():
        if (item[1] == 4):
            scribus.setColumnGap(columns_width, item[0])

scribus.setUnit(unit)

save this in a text file (not a word file!) with the extension py (something like set-column.py; make sure that the spaces are kept exactly this way) and run it from scripter > execute script...

spibo

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
  • Scribus User
Re: How to Change Column Gap En Masse (Version 1.4.7)
« Reply #4 on: March 29, 2019, 12:35:56 pm »
Thank you a.l.e.

 

palmate