Installed Scribus on OSX - can't use terminal commands

Previous topic - Next topic

mysterymonkey

Excited by the opportunity to command line the app to automate pdf production.
Installed okay (not Ghostscript, as don't need the features and told don't need to generate pdf)

Excuse me, as I'm a command line newb...
Open the app with...open -a Scribus
works fine

Don't really understand how you would use the examples here...
from https://wiki.scribus.net/canvas/Help:Manual_Commandline

So looking through basics here...
https://wiki.scribus.net/canvas/Command_line_scripts

but any attempt to run a command line example
(i.e. scribus -g -ns   -py create_square_document.py   -pa side 1000)
is met with stubborn...
-bash: scribus: command not found

Am I missing something really basic in Command Line knowledge.
Sorry, if this is really basic error...




a.l.e

which version of scribus are you using?

The command you pasted is for 1.5.2

And if you can "open -a Scribus", then you should start your command line with something like:

/Applications/Scribus-1.5.app/Contents/MacOS/Scribus -g ...

ciao
a.l.e

mysterymonkey

Thanks for the quick reply - I'm running scribus-1.4.6
But am downloading 1.5.2 as we speak.

Appreciate the command line suggestion - will post back results soon

I'm trying to automate the creation of .sla files (by writing the file code directly using an existing system we have)
and just wanted to create a pdf of the resulting file using the command line.

I'm in full "down with Adobe" mode at the moment!

mysterymonkey

Okay some progress (feeling like a proper moron today)

Installed Scribus 1.5.2
Have test document on my desktop (ScribusTest.sla)
Have create test python script (to-pdf.py) on my desktop
...from example here https://wiki.scribus.net/canvas/Command_line_scripts#Example_of_command_line_script_without_arguments
_______________________
# Produces a PDF for the SLA passed as a parameter.
# Uses the same file name and replaces the .sla extension with .pdf
#
# usage:
# scribus -g -py to-pdf.py file.sla

import os

if scribus.haveDoc() :
    filename = os.path.splitext(scribus.getDocName())[0]
    pdf = scribus.PDFfile()
    pdf.file = filename+".pdf"
    pdf.save()
else :
    print("No file open")
_______________________


run the proposed command (with your suggested addition)
/Applications/Scribus.app/Contents/MacOS/Scribus -g -py to-pdf.py ScribusTest.sla

--get following error in command line...
Python script to-pdf.py does not exist, aborting.

Should I be putting the python scripts in a specific location
or specifying the path to the script in the statement?

Apologies again for newbie mistakes/misconceptions...





mysterymonkey

okay - some progress??

figured the path for the python script in the command statement - so now run...
/Applications/Scribus.app/Contents/MacOS/Scribus -g -ns -py /Users/mark.vanstone/Desktop/to-pdf.py /Users/mark.vanstone/Desktop/ScribusTest.sla
(I added the -ns to stop the splashscreen, which seems to pop up even if Scribus already running?)

...so no more complaints it can't find the python script, but now the following helpful crud in terminal...
Path = /Applications/Scribus.app
"scpaths: bundle at /Applications/Scribus.app"
"scpaths: doc dir=/Applications/Scribus.app/Contents/share/doc/scribus/"
"scpaths: icon dir=/Applications/Scribus.app/Contents/share/scribus/icons/"
"scpaths: font dir=/Applications/Scribus.app/Contents/share/scribus/fonts/"
"scpaths: sample dir=/Applications/Scribus.app/Contents/share/scribus/samples/"
"scpaths: script dir=/Applications/Scribus.app/Contents/share/scribus/scripts/"
"scpaths: template dir=/Applications/Scribus.app/Contents/share/scribus/templates/"
"scpaths: lib dir=/Applications/Scribus.app/Contents/lib/"
"scpaths: plugin dir=/Applications/Scribus.app/Contents/lib/"
"scpaths: QML dir=/Applications/Scribus.app/Contents/share/scribus/qml/"
"scpaths: qtplugins=/Applications/Scribus.app/Contents/PlugIns:/Applications/Scribus.app/Contents/MacOS"
Fontconfig error: Cannot load default config file
pathForIcon: Unable to load icon /Applications/Scribus.app/Contents/share/scribus/icons/1_5_1/AppIcon.png: File not found
pathForIcon: Unable to load icon /Applications/Scribus.app/Contents/share/scribus/icons/1_5_1/AllCaps.png: File not found
pathForIcon: Unable to load icon /Applications/Scribus.app/Contents/share/scribus/icons/1_5_1/Kapital.xpm: File not found
pathForIcon: Unable to load icon /Applications/Scribus.app/Contents/share/scribus/icons/1_5_1/Strike.xpm: File not found
pathForIcon: Unable to load icon /Applications/Scribus.app/Contents/share/scribus/icons/1_5_1/outlined.png: File not found
pathForIcon: Unable to load icon /Applications/Scribus.app/Contents/share/scribus/icons/1_5_1/shadow.png: File not found
pathForIcon: Unable to load icon /Applications/Scribus.app/Contents/share/scribus/icons/1_5_1/shade.png: File not found
pathForIcon: Unable to load icon /Applications/Scribus.app/Contents/share/scribus/icons/1_5_1/Revers.png: File not found
No file open