-
Notifications
You must be signed in to change notification settings - Fork 37
Running Scribus Generator from the command line
As running Scribus Generator from the command line is currently the only option for Mac users, below is a short introduction that may help. It works just the same way for Linux users, and nearly just so for Windows users.
- http://blog.teamtreehouse.com/introduction-to-the-mac-os-x-command-line
- https://www.macworld.co.uk/how-to/mac-software/how-use-terminal-on-mac-3608274/
After reading the documents above, let's imagine that your SLA template and CSV data are in your folder Documents/scribus, and that you downloaded ScribusGenerator-master.zip from Github (or the Python3 version ScribusGenerator-python3.zip for Scribus 1.5.6+) and uncompressed it in your folder Downloads/ScribusGenerator-master. You would then
- open a Terminal
- go to your project directory:
cd ~/Documents/scribus
- create a shortcut to Scribus Generator (SG, in short) in your project folder:
ln -s ~/Downloads/ScribusGenerator-master/ScribusGeneratorCLI.py .
- check that SG works:
./ScribusGeneratorCLI.py --outDir test Business_Card.sla
. This step should create 10 SLA files with a business card in the Documents/scribus/test folder in less than a second. - understand the available options to run SG from the command line (they are basically the same as the GUI), either online or directly from your command line:
./ScribusGeneratorCLI.py --help
- invent a command that will suit your needs, maybe something like:
./ScribusGeneratorCLI.py --csvFile newsletterData.csv --outDir . --outName "newsApril_%VAR_name%" newsletterTemplate.sla
(in one single line!, to generate a different SLA document for each recipient based on their name), or./ScribusGeneratorCLI.py --csvFile newsletterData.csv --outDir . --merge newsletterTemplate.sla
(in one single line!) to generate a single SLA files with all your data entries. - open the generated SLA files with Scribus to enjoy the result... and generate a pdf or an image out of it.
If you want more help to create a particular command don't hesitate to give me a few more details on your particular needs in a new issue... We'll make a collection of those on this wiki ;)
A useful next step is then to generate PDF documents out of all the SLA documents, once you checked them out. For that purpose
- download the to-pdf.py script by Ale Rimoldi, into your Downloads/ folder.
- go to your project directory:
cd ~/Documents/scribus
- run the script to generate PDF documents from all SLA files in the current directory
scribus -g -py ~/Downloads/to-pdf.py -- *.sla
This step may take a while if you have many files, nothing I can do. Just tell the people at Scribus how important it is they make that process less obstructive by joining the discussion here.