getText() returns nothing

Previous topic - Next topic

zenkon

Hey there,
i am really struggling with this one:
i call the getText function after selecting some text in a text frame but the function return a empty string even though I can set the color of the selected text.
Any ideas?

Thanks
Zenkon

a.l.e

works here with the current scribus code...

which version of scribus are you using?

zenkon

Hey,
thanks for your reply. I am using scribus 1.4.8 in a debian enviroment.

a.l.e

hi

print(scribus.getText())

or

print(getText())

also work in my 1.4.8 with debian...

zenkon


mainTextBox = scribus.createText(120.0,120.0,40.0,60.0)
scribus.insertText("Hello World",0,mainTextBox)
scribus.selectText(0,scribus.getTextLength(), mainTextBox)
text = scribus.getText()
print(text)

a.l.e

oh! ah ah!

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

<rant>people, please provide enough context in your questions!
attach sample .sla and .pdf files or, in this case, a script snippets that let us reproduce your issues...
... and, no, most of the time a screenshot is not enough...
life is so much easier when we don't have to rely on our crystal ball!</rant>


zenkon

I am not really sure if I understand this correctly. It was a bug and it is now fixed in 1.5.6? But if so why does it work on your system? Sorry ^^

Nermander

Probably because a.l.e did not create the text with insertText, but typed it manually in the document.

Nothing in the initial post said the text had been entered using insertText.

zenkon

Ok, but is there a solution to my problem?

a.l.e

yes, go and read the bug report i've linked above.
(small hint: getAllText())

or get the latest scribus and do an update after the insert.

ciao
a.l.e

zenkon

It works, thanks for your help.
Keep up the good work.