Recent posts

#61
Scripts and Plugins / Replacing selected text
Last post by prcek - May 09, 2025, 03:28:12 PM
Hello everyone.

I'm trying to write a script that gets a selected text from a frame, changes it and replaces the original text by the new one.

What I cannot find out is how can I get the selection's start position to insert the new text at.

Here is very simplified version of my script, that should put selected text into parentheses.
It expects a text in a text frame selected.
Of course if you select text from start it will work.

import scribus

frame = scribus.getSelectedObject()
txt = scribus.getAllText(frame)
txt = '(' + txt + ')'
scribus.deleteText(frame)

position = 0
scribus.insertText(txt, position, frame)

scribus.layoutTextChain(frame)
scribus.setRedraw(True)
scribus.docChanged(True)

I want to avoid workarounds like getting the selected text and search it to get it's position as there is no certainty it is unique.

Is there any function like getTextSelection([name]) or similar?

#62
General Discussion / Re: Story Editor - Font Menu
Last post by a.l.e - May 09, 2025, 09:51:07 AM
The patch is in.

The next development snapshot will have it.
It's already in the "nightly" AppImage:
#63
Beginner Talk / Re: Unlinking text frames
Last post by occamsrazor - May 07, 2025, 05:55:21 PM
Thank you! I never thought I was supposed to cut the text.
#64
Beginner Talk / Re: Beginner consider giving u...
Last post by Jensus - May 07, 2025, 04:33:44 AM
I found WPS Writer, which seems to work like MS Word (which I haven't used for very long). It is easier to use for this purpose than LibreOffice, image handling is much smoother. For what I see now, WPS Writer is the solution for this kind of document.

If that would not work, Affinity may be an option. It's a professional book editing software that seems to be able to do what I want.

I will keep Scribus, because I have another book project, which is more text and less images, for which Scribus will probably be very useful.

Thanks all for your help.
#65
Raster and Vector Graphics / Re: fuzzy images - why is this...
Last post by AdmFubar - May 07, 2025, 03:43:47 AM
Quote from: rocking on May 06, 2025, 04:02:24 AMThe selected value was "Normal resolution".  I changed it to High and now it looks good.  It's a bit of a pain to do this for every image.


There is a per document setting for image resolution to display. It is in the view menu, It is set to Normal usually. Look for it in the main toolbar, it is usually the last section and has monitor with some color block displayed in it (color management), and an eye icon (print preview), and an edit in preview mode, (looks like an old ink pen) and another drop down menu for previewing your document in various color vision deficient versions)
#66
Raster and Vector Graphics / Re: fuzzy images - why is this...
Last post by Nermander - May 06, 2025, 08:33:16 PM
The setting only affects the display when working on the document. PDF export will use the full resolution no matter this preview setting.

And in Document setup, under Item tools and Images you can set the default (but I suspect it only applies to newly created image frames).

I am not sure if there is an easy way to change for all already created image frames, but using the Outline window it is a lot easier than to do it on each page. Maybe it is possible to select multiple image frames and change the setting for all of them at the same time...

Yes, that seemed to work, I created two image frames, selected them both and changing the Preview setting then changed it for both.
#67
Beginner Talk / Re: Unlinking text frames
Last post by a.l.e - May 06, 2025, 06:48:27 PM
i also had to a few tries...

  • select the first frame in the new chain
  • item > text frames links > unlink text frames and cut text

unlink-with-cut.gif
#68
Beginner Talk / Re: Unlinking text frames
Last post by occamsrazor - May 06, 2025, 02:21:34 PM
Hi a.l.e,

I'm trying to get rid of the link marked with the red arrow. My Scribus is version 1.6.4

Screenshot 2025-05-06 151725.png
#69
Raster and Vector Graphics / Re: fuzzy images - why is this...
Last post by rocking - May 06, 2025, 04:02:24 AM
Quote from: a.l.e on May 05, 2025, 07:14:58 PMIf you right click (well, trigger the context menu...) on the image, and go into the "Preview Settings", what is the currently selected value?

If it's "Low Resolution", you now know what is happening...

I did not realize that menu was there, obviously have never had to use it before.

The selected value was "Normal resolution".  I changed it to High and now it looks good.  It's a bit of a pain to do this for every image.

Thank you to a.l.e. for bringing this to my attention.
#70
Beginner Talk / Re: Beginner consider giving u...
Last post by AdmFubar - May 06, 2025, 02:45:52 AM
LayTeX is a front for TeX, so yes that may work for you.