Author Topic: command line to run scribus scripts.  (Read 592 times)

digirew

  • Jr. Member
  • **
  • Posts: 81
  • Karma: 0
  • Scribus User
command line to run scribus scripts.
« on: September 22, 2020, 06:11:08 pm »
Iv been looking at the command line page https://wiki.scribus.net/canvas/Command_line_scripts

What im trying to accomplish is, while I have a document open in Scribus (GUI), is it possible to have another program tell scribus to run a script? (instead of doing it manually from the script menu?)

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2473
  • Karma: 36
    • the graphics lab
Re: command line to run scribus scripts.
« Reply #1 on: September 22, 2020, 09:33:37 pm »
i think it should be possible by enabling extension scripts and running a script at startup that checks for commands...

i guess i should do something fancy with it one day (and first check if it does work as i think it does)

on the other side, if somebody knows how to send commands to a multiplatform Qt application i'm  willing to look at it...

digirew

  • Jr. Member
  • **
  • Posts: 81
  • Karma: 0
  • Scribus User
Re: command line to run scribus scripts.
« Reply #2 on: September 22, 2020, 10:11:37 pm »
a.l.e, your comment:

i think it should be possible by enabling extension scripts and running a script at startup that checks for commands...

Maybe im not understanding correctly, but im not sure if this would even be possible? as it looks like running any of the command lines always want to start a new instance of Scribus instead of the existing copy of Scribus already opened.



a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2473
  • Karma: 36
    • the graphics lab
Re: command line to run scribus scripts.
« Reply #3 on: September 22, 2020, 10:26:41 pm »
of course it's not the same as running a new script... but i wonder how far one could go with a polling system.

for a real solution, something like d-bus will be necessary.

digirew

  • Jr. Member
  • **
  • Posts: 81
  • Karma: 0
  • Scribus User
Re: command line to run scribus scripts.
« Reply #4 on: September 22, 2020, 10:31:19 pm »
The command line tool appears to be a very powerful feature that allows you to do some pretty creative things using Scribus. Being able to run scripts via. command line on the active document would definitely take it to a new level of possibilities.

dragonfly

  • Full Member
  • ***
  • Posts: 203
  • Karma: 0
  • Scribus User
Re: command line to run scribus scripts.
« Reply #5 on: September 22, 2020, 10:57:52 pm »
I do this quite often on a number of GUI's.  And I'm looking at Scribus also for my workflow.
But unfortunately the solution I propose depends on your OS.

It is to use automation scripts which autodrive the Scribus GUI and allows integration with a toolchain.

That is instead of (or in addition to) using Scripter to navigate the Scribus API you run macros which navigate existing hotkeys and menus in "autopilot mode".  It isn't as daft as it sounds.

I am on Ubuntu 20.04.

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2473
  • Karma: 36
    • the graphics lab
Re: command line to run scribus scripts.
« Reply #6 on: September 23, 2020, 10:17:12 am »
digireview: which kind of possibilities do you have in mind?

digirew

  • Jr. Member
  • **
  • Posts: 81
  • Karma: 0
  • Scribus User
Re: command line to run scribus scripts.
« Reply #7 on: September 23, 2020, 06:55:09 pm »
A.l.e,

Having the ability to run additional scripts while a document is already opened, we would open the door to a lot of automation and completely offload repetitive tasks that need to be done by users.

A few basic examples would be to issue a save/pdf command from our application when a user is done with a document. Our application can then handle all the remaining tasks a user needs to do with each file. Or saving a revision history of documents being working on into our applications database.

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2473
  • Karma: 36
    • the graphics lab
Re: command line to run scribus scripts.
« Reply #8 on: September 24, 2020, 08:08:48 am »
from a scribus point of view, that looks to me an over engineered process.

i don't know much about your workflow, but i somehow have the feeling, that having a way to start scripts by pressing a button would be a better solution.
at the end, the user might need to press not one but two buttons, one in scribus and one in a project management application, but the reduced level of magic might also reduce the fear of making errors.

this having been said, triggering other tasks while or after producing a pdf is something that should already possible with the current feature set in the development version of scribus (and probably also in the stable version).

personally, i still would love having ways to send messages to open instances of scribus, but i really don't see how this can happen in a multi plaftorm way...
if you have ideas...

(btw, the fact that you technically can have multiple instances of scribus open at the same time -- a good feature -- even with the same active open document -- less good feature -- will not help in this endeavour...)

dragonfly

  • Full Member
  • ***
  • Posts: 203
  • Karma: 0
  • Scribus User
Re: command line to run scribus scripts.
« Reply #9 on: September 24, 2020, 12:42:23 pm »
@digirew

What OS platforms are you using?

Windows/Linux/Mac

digirew

  • Jr. Member
  • **
  • Posts: 81
  • Karma: 0
  • Scribus User
Re: command line to run scribus scripts.
« Reply #10 on: September 24, 2020, 05:49:12 pm »
dragonfly,

we use Windows and Mac.