Launching scribus script, from outside of Scribus

Previous topic - Next topic

ScripterBoy

Is there any way for starting an scribus script from an external python script?.

Thank you in advance.

a.l.e

No, strictly speaking, you cannot.

But you can start with Scribus 1.5 with a startup script and get it to automatically quit.

https://wiki.scribus.net/canvas/Command_line_scripts

You still need the GUI to start, but it works...

If this fits your needs, I can further help you...

ScripterBoy

Thank you so much for your answer.

So, in that case, is it possible to create a python script acting like "daemon", which would be "hearing" over one folder? (I would like to use Scribus inside a workflow, and I need to launch some processes when a file arrives to one folder)

Once again... thank you for your help.

a.l.e


dragonfly

QuoteIs there any way for starting an scribus script from an external python script?.

Yes, in my own kicking around with building a Scribus custom workflow I have found ways of "pushing" content (document fragments) into a Scribus *.sla file. 

The usual approach is to have Scribus GUI open and launch a python script through Scribus window > scripts to "pull" content into Scribus.  Each script must import scribus.

However in some scenarios Scribus may not be present.

The approach I have tested for my own ends is to regard the template *.sla as an *.xml file and then use xquery script to update the xml elements in the *.sla document without the need to launch Scribus GUI.   The *.sla templates are held in an xml nosql database. The xpaths to textframe or imageframe or even styles must be known in advance and these can easily be found from any xml editor. This is indeed "pushing" content instead of "pulling".

In your workflow you would have a daemon watching your folder and on change trigger the xquery script to push content into xml elements.

Python elementtree will also do this.