[scribus] Error in script from Wiki

Juraj Fedel wtxnh-scribus at yahoo.com.au
Sat May 19 18:36:42 UTC 2018


On Sat, May 19, 2018 at 05:45:23PM +0200, Viktor Trojanovic wrote:
> I have little to no experience with Python. All I could verify is
> that the script creates quite a few error messages when checked on
> www.pep8online.com.

None of script for Scribus will run on pep8online, they need to run within Scribus.
Steps to run the script correctly:
1. open Scribus
2. open document
3. select frame that you want to export
4. run script from menu 'Scripter > Execute Script ...'
   find the place where you saved your script and pick it
5. Script will create new document with one page sized as your selected frame
   You can then export this one page to PDF

All that said there is one error in script:

<<<<<<<<
if scribus.haveDoc():

else:
    scribus.messageBox('Usage Error', 'You need a Document open', scribus.ICON_WARNING, scribus.BUTTON_OK)
    sys.exit(2)
========
if scribus.haveDoc():
    pass
else:
    scribus.messageBox('Usage Error', 'You need a Document open', scribus.ICON_WARNING, scribus.BUTTON_OK)
    sys.exit(2)
>>>>>>>>

There is missing one line with single command in it:
    pass

add that line and script will run fine.

Bye
Juraj



More information about the scribus mailing list