[scribus] Patch submitted for Command Line Arguments to be passed to python script

ale rimoldi ale.comp_06 at xox.ch
Mon Sep 14 19:39:55 UTC 2015


hi greg

here a sample script for replacing the text in a specific text frame
through a variable text and produce a pdf:

https://github.com/aoloe/scribus-script-sample/blob/master/to-pdf-with-placeholder/to-pdf-with-placeholder.py

in this sample i am using the getopt library from the standard python
library to parse the arguments.
a bit overkill for the two arguments defined in this script, but IMO a
good tool as soon as the script gets more complicated.

btw, in a real world script i would probably avoid passing the values
for replacing the placeholders through the command line and pass them
as a json file:

$ scribus -g -py to-pdf.py -j my-values.json base-document.sla

voilà, my conclusion: being able to pass arguments to a script is
a wonderful new feature... but, personally, i would not try to pass
more than one or two arguments...

but, maybe, someone shows up with good examples where it's efficient to
pass multiple arguments. who knows?

have a nice evening
a.l.e



More information about the scribus mailing list