Copy Size of Object

Previous topic - Next topic

hibert42

Hey,
I am looking for a solution to set the size of an object to that of another.

Example 1:
I have a Text Frame and want it to have the same width as a ceatain Image Frame,
but only the width. Intuitively, I am looking for something like:
copy width from

I know, I can copy the width value and paste it to the Textframe. But maybe there is a script or even a built-in function that already does that.

Example 2:
I want an Image Frame to have the width and height of my page.

And so on and on...

Thanks in advance

a.l.e

since you seem to be comfortable with scripting, you can write scripts for these tasks.

but for the two examples you're mentioning there are also other solutions.

For example 1 you can:

  • if you have not created the text frame yet, copy paste the image frame (sadly, duplicate does not duplicate in place: i've lost that battle) and convert the newly created item into a text frame (it's in the context menu, in the item menu, and can be triggered with the action search). they will have the same size
  • or you can activate the "item snapping" and make both items of the same width
  • or you can use the property palette and copy paste the width of one item into the other one
  • or use guides to define the width of your elements and resize both items to it

which one fits better, depends on your habits and on the specific use case.

concerning example 2:

  • if the page is what is inside of the margins, you can simply activate the image tool and shift click inside of the page (works only if you have not defined any guide).
  • if you want it to be of the size of the page, you can set the width of the image to "pagewidth" and its eight to "pageheight" (yes, those are two variables that are recognized by the measurement fields; you can even do calculations with them like "pageheight + 2 + 1cm")
  • you can also simply activate the snapping to guides and use the mouse to snap the frame to the page.

this having been said, in most cases, you don't want to set the size of the image to the exact size of the page but want to fill the bleed area with it: scribus will also snap to it, if you have defined one. (and if you have 1cm bleed, you can set the position to "-1cm" and then set the width to "pagewidth+2cm")

hibert42

Yeah I already started ;)
It is a good exercise.

Currently I already can set any frame to the pages size but also to any percentage of the pages size and you can choose if you want width, height or both :)

But i won't stop there.
Going to include the following featurs to make a "Frame Tool" Script.
1. Set size not just to that of Pages, but also other objects via "last selected" or "first selected" method.
2. Set Size of multiple frames
3. Also respositioning, the same as in the alignment tool panel, but here you can just resize and align at the time
4. Also including the Align Image inside Frame from the built-in Script
5. Adding Resize Image inside Frame functionality too ...

hibert42

well.... I have to admit, I wrote my rsponse before reading yours.

Item Snapping... I did not know about that.
And I have spent the entire last day writing a script.

Well at least I now have a script to set the a frame to the size of the page + bleeding.

Quotescribus will also snap to it, if you have defined one.
is it?
I tried it and it is not snapping to the bleed extension...



du dumm

utnik

hi hibert42

Quote from: hibert42 on May 19, 2025, 11:09:18 AM...I tried it and it is not snapping to the bleed extension...
for me it does (in 1.6.4 and 1.7.0) – at least as long as 'snap to guides' is active.

utnik

hibert42

Yes it seems to be a little bit inacurate by times.
It works! But Sometimes it doesn't. I zoom a little bit and it works!