Scribusoid

Author Topic: Resize multiple text frames simultaneously  (Read 2297 times)

AliasHannibal

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
  • Scribus User
Resize multiple text frames simultaneously
« on: August 27, 2018, 05:08:29 pm »
As a regular user of Scribus (I've typeset several books, and designed book covers, etc), I sometimes realize that I need to resize several text frames after I've created the document.

To do this I have to go to each frame and copy and paste (or type, but that's slower) the exact measures for the text frames. When I need to do this for a whole book (more than let's say 30 pages, but I often work with books of more than 200 pages), it is a hopeless job that takes forever. And since it could be automated, I wonder if there's a better way to do this.

I can create new documents and let Scribus automatically create text frames for me, but if I've already worked on several other features in this document, this becomes less attractive as an option.

If I try and zoom out and select all the text frames, I have found that the text frames behave erratically. Sometimes they resize unevenly, or in proportion to each other. This is not what I want. I want to change all of them at the same time to the same measurements.

Is there any other way to change the size simultaneously? Thanks in advance.

Nermander

  • Hero Member
  • *****
  • Posts: 1441
  • Karma: 19
Re: Resize multiple text frames simultaneously
« Reply #1 on: August 27, 2018, 05:58:02 pm »
I'd say the best way is probably to write a script for it.

I don't think it would be very hard to write a script that does "Every frame with these measures shall be changed to this size". A loop and a couple of if statements.

AliasHannibal

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
  • Scribus User
Re: Resize multiple text frames simultaneously
« Reply #2 on: August 27, 2018, 06:08:39 pm »
Thanks for the quick reply.

That would be great. I know nothing about how to do that. Do you?

Nermander

  • Hero Member
  • *****
  • Posts: 1441
  • Karma: 19
Re: Resize multiple text frames simultaneously
« Reply #3 on: August 27, 2018, 08:54:23 pm »
I have not yet bothered to learn the Scribus scripter, but I think there is already a sample script out there that iterates through all text frames in the document. I would think it is not very complicated to adjust it with a few if statements, at least if you know a little about programming.

AliasHannibal

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
  • Scribus User
Re: Resize multiple text frames simultaneously
« Reply #4 on: August 27, 2018, 09:02:40 pm »
Sorry. I don't. I am hopeless with any sort of programming. But I really appreciate you guiding me in the right direction. Thanks.

Ewac

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
  • Scribus User
Re: Resize multiple text frames simultaneously
« Reply #5 on: June 16, 2021, 07:30:49 am »
Has there been a solution to this issue in the past years? I'm in the same situation and would really appreciate a way to rezise multiple frames together....

RobSay

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
  • Scribus User
Re: Resize multiple text frames simultaneously
« Reply #6 on: June 16, 2021, 08:29:19 pm »
I'm not aware of any new solutions to this and I use scripter to achieve a similar sort of effect (standard width image frames over 250 pages)

For a straight forward resize of all frames within the whole document - you can run this in the scripter console:
Code: [Select]
# select all the items in the document - you can be much cleverer than this with page ranges etc
allItems = getAllObjects()
# loop through all the objects
for item in allItems :
  # look for text frames only - you can be cleverer here in lots of ways and filter by type, name, property .. whatever
  if (getObjectType(item) == 'TextFrame'):
    # set the frame dimensions (you can calculate the desired width and height etc)
    sizeObject(200,30, item)
    # you could also move the text frame to a specific point on the page (might need to check the current page)
    # moveObjectAbs(x,y,item)