Skip to content

Instantly share code, notes, and snippets.

@stelf
Last active September 5, 2017 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stelf/d4e72a19ce1dbb18bffce4d4768d48ba to your computer and use it in GitHub Desktop.
Save stelf/d4e72a19ce1dbb18bffce4d4768d48ba to your computer and use it in GitHub Desktop.
the missing scribus.replaceText() call which preserves styles
import scribus
tb = 'Text2'
repl = 'new cntent'
l = scribus.getTextLength(tb)
scribus.selectText(0, l-1, tb)
scribus.deleteText(tb)
scribus.insertText(repl, 0, tb)
l = scribus.getTextLength(tb)
scribus.selectText(l-1, 1, tb)
scribus.deleteText(tb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment