[scribus] Set properties on several frames at once
Gregory Pittman
gpittman at iglou.com
Mon Oct 7 18:55:15 UTC 2019
On 10/7/19 2:07 PM, Giovanni Bianchessi wrote:
>>
>> Message: 3
>> Date: Sun, 6 Oct 2019 13:23:43 -0400
>> From: Gregory Pittman <gpittman at iglou.com>
>> To: scribus at lists.scribus.net
>> Subject: Re: [scribus] Set properties on several frames at once
>> (Scribus 1.5.5)
>> Message-ID: <eed0e8e8-98a9-1eaa-d9c4-22c6963a3fc0 at iglou.com>
>> Content-Type: text/plain; charset=utf-8
>>
>> On 10/6/19 12:39 PM, Ari Constancio wrote:
>>> Hi everyone,
>>>
>>> Is there any way to select several frames simultaneously in order to set a
>>> given property (width, text font, etc.)? Does this make sense?
>>> Thanks in advance!
>>> Best regards,
>>>
>> Hi Ari,
>>
>> The short answer is no. You can certainly select more than one frame by holing down Shift and left-clicking frames, but you will see that Text Properties is greyed out, even if you Group the frames.
>>
>> If I had some need for this, I would probably write a script to work sequentially on a series of selected frames.
>>
>> For text frames in particular, this is where the advantage of Paragraph and Character Styles come into play. Once you create and apply these Styles, then changing various parameters for the Style changes it wherever it is used.
>>
>> Greg
>>
>
>
> It could be very useful and quick, in example, to adapt a frame to image (for multiple, dozens of, selected images), but the teutonic rigidity of Scribus forbids that...
> I have to select one, mouse, contextual adapt frame to image, select one, mouse, contextual adapt frame to image, select one, mouse, contextual adapt frame to image, select one, mouse, contextual adapt frame to image, .....
Hi Giovanni,
For that purpose, check out this script:
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
More information about the scribus
mailing list