book --> delete page --> all text frames are outside margins

Previous topic - Next topic


I've made a book with 20 pages. With a leftpage and a rightpage with different margins.
Now I delete page 5 (rightpage). So page 6 (leftpage) is now page 5. With "apply masterpage" I can change the layout of page 5, so now page 5 is a rightpage.
But the textframes did not change from position. They are outside the left margin. I can move them manualy frame by frame, and put them inside the margins. But that's a lot of work.
How can I do this automaticly?


I've made a proposal for an extension to the "apply master page" dialog:

if jean and craig agree with it, i can try to work on the "real" code behind it.



as a warm up i've created this script to horizontally move all items in a list of pages:

# horizontally move all the items in a list of pages by a give amount
# © mit, ale rimoldi, 2023

    import scribus
except ImportError:
    print('This script must be run from inside Scribus')

pagesString = scribus.valueDialog("", "Page numbers (separated by commas)")
horizontalMovement = int(scribus.valueDialog("", "Horizontal movement (in the current unit)"))

for page in [int(p.strip()) for p in pagesString.split(',')]:
        for item in scribus.getPageItems():
            scribus.moveObject(horizontalMovement, 0, item[0])
    except Exception as e:

download it as a raw file from github or copy the code above to your computer and run it from inside scribus.

it will ask for a list of pages and and and an amount of "current unit" to move all the items.

warning: i've not tested it, just programmed it, but it might help you.

all in all, in page layout it's always a good idea to always remove/add pairs of pages (when you're working with double sided layouts...) but sometimes one has to do crazy things...


Dear a.l.e.
This works perfect. You did a wonderful job. Thank you very much.
I just had to figure out how much I had to move, in my case 16.

Thank you very much


Quote from: a.l.e on March 30, 2023, 05:42:42 PMas a warm up i've created this script to horizontally move all items in a list of pages:
I hope this will be included in future releases.
Using Scribus 1.5.8 openSUSE 15.4
Advanced hobbyist


personally, i hope that the script will not be included!
it's really just a small script that solves a very specific problem.
something that should be in a collection of scripts, as it is now.

but, as i wrote above, i'm also working on adding to the "apply master page" dialog an option to move the frames according to the left/right margins


and THAT should be in scribus... if it indeed solves the problem...