Beginners Scripts

From Scribus Wiki
Jump to navigation Jump to search
This article is part of the Scripts series.
Script (w/ Screenshot) Scripter commands demonstrated
Elementary Rectangle
simple rectangle made with scribus python script
Elementary Rectangle generated from python
newDocument, createRect, setCornerRadius, setLineWidth, setFillColor, setLineColor, saveDocAs
Drawing Circles with Radii
Drawing Circles w/ Radii made with scribus python script
Drawing Circles with Radii generated from python
newDocument, createLine, setLineWidth, setLineColor, zoomDocument, saveDocAs
Making a dot gradient
Making a dot gradient made with scribus python script
Making a dot gradient generated from python
newDocument, createEllipse, setLineWidth, setFillColor, setFillShade, saveDocAs, currentPage, setHGuides, messageBox, statusMessage, progressReset
Adding 'DRAFT' to a document
Adding 'DRAFT' to a document made with scribus python script
Adding 'DRAFT' to a document generated from python
haveDoc, createLayer, getActiveLayer, setActiveLayer, createText, setUnit, setText, setTextColor, setFontSize, rotateObject
haveDoc, valueDialog, getUnit, setUnit, getPageSize, getPageMargins,
defineColor, createEllipse, setLineWidth, setLineColor, setFillColor, createLine, getPageSize, createRect
valueDialog, getColor, getLayers, createLayer, setActiveLayer, setHGuides, setVGuides, getHGuides, getVGuides, createText, setTextColor, insertText, setFontSize, setLineSpacing, defineColor, createRect, groupObjects, createLine, setLineColor, setLineWidth, createEllipse, haveDoc, messageBox
newDocument, createLine, setLineWidth, setLineColor, setFillShade, createRect, saveDocAs
haveDoc, getUnit, setUnit, getPageSize, getPageMargins, setMargins, messageBox, statusMessage, progressReset
haveDoc, setUnit, valueDialog, createLine, setLineWidth, setLineColor, setFillColor
haveDoc, createLine, setLineWidth, setLineColor, setFillColor, createText, setFont, setFontSize, setTextAlignment, valueDialog, messageBox, docChanged
createColor(), newDoc, createLine, setLineWidth, setLineColor, setFillColor, createLayer, setActiveLayer, createText, setFont, setFontSize, setTextAlignment, selectText, setTextDistances, valueDialog, messageBox
haveDoc, valueDialog, createLine, setLineWidth, setLineColor, setFillColor, createText, setTextColor, setText, setTextAlignment, setFont, setFontSize, rotateObject
haveDoc, valueDialog, setUnit, createLine, setLineWidth, setLineColor, setFillColor, createText, setTextColor, setText, setTextAlignment, setFont, setFontSize
fileDialog, haveDoc, setUnit, valueDialog, createLine, setLineWidth, setLineColor, setFillColor, createPolyLine
valueDialog, messageBox, haveDoc, importSVG – much of the script involves mathematical calculations
getPageSize, fileDialog, createImage, setScaleImageToFrame, setFillColor, setLineColor, getImageScale, sizeObject, haveDoc, messageBox
This is an old script (Scribus 1.3.3.3), so be sure to check the precise names of commands. If you find errors, let us know or edit the wiki page to correct.
messageBox, createLine, setLineColor, haveDoc, statusMessage, progressReset
There is a minor usage of Scribus commands here, but it does show how to set up a Tkinter dialog for multiple variable entry.
newDoc, newPage, createText, setText, setTextAlignment, setFont, setFontSize
This is almost a script fragment even though it could work on its own. What it shows is the basic operation to import information from a simple structured text file and incorporate into a document. Could be adapted for mail merge, for example.
haveDoc, selectionCount, getSelectedObject, setScaleImageToFrame, getImageScale, scaleImage, docChanged
not sure if this script works
haveDoc, selectionCount, getSelectedObject, setProperty, moveObject, docChanged
replaceColor, docChanged
This is a "script-let" really, but quickly shows how to change or delete colors in a document. No checking for errors.
haveDoc, fileDialog, messageBox, pageCount, getPageItems, gotoPage, getAllText, getImageFile
valueDialog, messageBox
This is a utility that just happens to run in Scribus, using the valueDialog and messageBox to do what the title says.
getPageSize, getPageMargins, createText, setFontSize, setTextAlignment, insertText, getColorNames, statusMessage, progressTotal, getColor, progressSet, haveDoc, openDoc, fileDialog, messageBox, getColorsFromDocument, newDocument, setUnit, deleteColor, defineColor, valueDialog, newPage, createRect, setFillColor, setLineColor
messageBox, valueDialog
haveDoc, selectionCount, messageBox, valueDialog, getSelectedObject, pageCount, currentPage, gotoPage. Also shows use of Python split function for parsing the input from valueDialog. copyObject and pasteObject are new commands that you will only have once you follow the directions to install them into your svn directory and rebuild Scribus.
getColors(), defineColor(), replaceColor(), deleteColor()
getColors(), defineColor(), replaceColor(), deleteColor()