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

Previous topic - Next topic

richard2023

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?

a.l.e

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

https://bugs.scribus.net/view.php?id=16918

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

PatJr


a.l.e

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

https://github.com/aoloe/scribus-script-repository/blob/master/move-page-items/move-page-items.py

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

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

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(',')]:
    try:
        scribus.gotoPage(page)
        scribus.deselectAll()
        for item in scribus.getPageItems():
            scribus.moveObject(horizontalMovement, 0, item[0])
    except Exception as e:
        pass


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...

richard2023

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

AdmFubar

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

a.l.e

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

apply_master_page.png

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

a.l.e