[scribus] Set properties on several frames at once

Giovanni Bianchessi bgio at libero.it
Sat Oct 12 11:13:32 UTC 2019


Thank you for the script.
Why this feature is not coded directly in Scribus?
Should Scribus users be script programmers too?

Regards
Giovanni


> Il giorno 08 ott 2019, alle ore 14:00, scribus-request at lists.scribus.net ha scritto:
> 
> Hi Giovanni,
> 
> For that purpose, check out this script:
> 
> https://wiki.scribus.net/canvas/Scale_an_Image_to_Fill_a_Frame_Proportionally <https://wiki.scribus.net/canvas/Scale_an_Image_to_Fill_a_Frame_Proportionally>
> 
> Note that, if you're using Scribus 1.5.x, you need to change the scaleImage() commands to setImageScale(). Aside from readjusting the scale of the Image, this also then adjust the size of the frame, so that the frame then gets adjusted to the image. Nowadays, you can use setScaleFrameToImage() and have a much simpler script:
> 
> ########################################################
> from scribus import *
> if haveDoc():
>    nbrSelected = selectionCount()
> 
> objList = []
> 	
> for i in range(nbrSelected):
>    objList.append(getSelectedObject(i))
> 	
> for i in range(nbrSelected):
>    try:
>        obj = objList[i]
>        setScaleImageToFrame(True, False, obj)
>        setScaleFrameToImage(obj)
>        docChanged(1)
>        setRedraw(True)
>    except:
> 	    nothing = "nothing"
> ########################################################
> 
> The reason Jeremy did it his way was that the setScaleFrameToImage() command didn't exist then. There is no error-checking, so if you include a text frame, for example, you'll generate an error.
> 
> Greg
> 

-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20191012/54f1fde9/attachment.html>


More information about the scribus mailing list