Scribusoid

Author Topic: Launching scribus script, from outside of Scribus  (Read 66 times)

ScripterBoy

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Scribus User
Launching scribus script, from outside of Scribus
« on: September 07, 2018, 02:50:48 pm »
Is there any way for starting an scribus script from an external python script?.

Thank you in advance.

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1532
  • Karma: 23
    • the graphics lab
Re: Launching scribus script, from outside of Scribus
« Reply #1 on: September 07, 2018, 03:11:43 pm »
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

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Scribus User
Re: Launching scribus script, from outside of Scribus
« Reply #2 on: September 07, 2018, 03:24:21 pm »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1532
  • Karma: 23
    • the graphics lab
Re: Launching scribus script, from outside of Scribus
« Reply #3 on: September 07, 2018, 03:58:54 pm »
please, don't ask twice the same question...

you can find my reply in http://forums.scribus.net/index.php/topic,3055.msg14180.html#msg14180

dragonfly

  • Jr. Member
  • **
  • Posts: 79
  • Karma: 0
  • Scribus User
Re: Launching scribus script, from outside of Scribus
« Reply #4 on: September 07, 2018, 06:27:01 pm »
Quote
Is 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.

 

palmate