Difference between revisions of "Category:Scripts"

From Scribus Wiki
Jump to: navigation, search
(Created page with "Category:Categories")
 
Line 1: Line 1:
 
[[Category:Categories]]
 
[[Category:Categories]]
 +
[[Category:HOWTO]] [[Category:EN]] [[Category:Categories]]
 +
'''Other languages:''' [[:Category:Skrypty_i_wtyczki|Polski (pl)]] [[:Category:Scripts_e_Plugins|Portuguese (pt_BR)]]
 +
 +
 +
= Scripter =
 +
 +
A new script engine is currently being integrated into Scribus. The next steps will be:
 +
* get the script engine to work (should already be ok)
 +
* get the editor to work (i'm stucked there)
 +
* revise the structure of the API
 +
* add new functions to the API
 +
 +
 +
* [[Scripter Architecture]]
 +
* [[Scripter API]]
 +
* [[Scripter/Images| Objects: Images]]
 +
* [[Scripter/Databases| Databases]]
 +
* Alessandro Rimoldi's blog series on scripter functions - [http://www.graphicslab.org/Blog/Blog a_l_e's blog]
 +
 +
== Script snippets ==
 +
 +
This section contains snippets you can use to create your own scripts.
 +
 +
It will feature:
 +
 +
* reading a file
 +
* updating a status bar
 +
* selecting a frame
 +
* pausing the screen update
 +
 +
 +
* [[Scripter/Snippet/Main| main()]]
 +
 +
==Beginners Scripts==
 +
{| cellpadding=5px |
 +
! Link to Script !! Scripter commands demonstrated
 +
|-
 +
| width=390px |
 +
* [[Elementary Rectangle]]
 +
| newDoc, createRect, setCornerRadius, setLineWidth, setFillColor, setLineColor, saveDocAs
 +
|-
 +
|
 +
* [[Drawing Lines and Python "For loops"]]
 +
| newDoc, createLine, setLineWidth, setLineColor, setFillShade, createRect, saveDocAs
 +
|-
 +
|
 +
* [[Making a dot gradient]]
 +
| newDoc, createEllipse, setLineWidth, setFillColor, setFillShade, saveDocAs, currentPage, setHGuides, messageBox, statusMessage, progressReset
 +
|-
 +
|
 +
* [[Adding 'DRAFT' to a document]]
 +
|  haveDoc, createLayer, getActiveLayer, setActiveLayer, createText, setUnit, setText, setTextColor, setFontSize, rotateObject
 +
|-
 +
|
 +
* [[Making layout grid with guides]]
 +
| haveDoc, valueDialog, getUnit, setUnit, getPageSize, getPageMargins,
 +
|-
 +
|
 +
* [[Creating Markers for positioning and cutting]]
 +
| defineColor, createEllipse, setLineWidth, setLineColor, setFillColor, createLine, getPageSize, createRect
 +
|-
 +
|
 +
* [[Creating Markers - another version]]
 +
| valueDialog, getColor, getLayers, createLayer, setActiveLayer, setHGuides, setVGuides, getHGuides, getVGuides, createText, setTextColor, insertText, setFontSize, setLineSpacing, defineColor, createRect, groupObjects, createLine, setLineColor, setLineWidth, createEllipse, haveDoc, messageBox
 +
|-
 +
|
 +
* [[Bleed, create markers and export a document to pdf]]
 +
|-
 +
|
 +
* [[Making margins in Gutemberg way]]
 +
| haveDoc, getUnit, setUnit, getPageSize, getPageMargins, setMargins, messageBox, statusMessage, progressReset
 +
|-
 +
|
 +
* [[Generate a ten page layout with three columns on each page]]
 +
|-
 +
|
 +
* [[Generating a Postnet barcode]]
 +
| haveDoc, setUnit, valueDialog, createLine, setLineWidth, setLineColor, setFillColor
 +
|-
 +
|
 +
* [[Generating a Code39 Barcode]]
 +
| width=550px| haveDoc, createLine, setLineWidth, setLineColor, setFillColor, createText, setFont, setFontSize, setTextAlignment, valueDialog, messageBox, docChanged
 +
|-
 +
|
 +
* [[A Standard Form with Barcodes and Custom Entries]]
 +
| newDoc, createLine, setLineWidth, setLineColor, setFillColor, createLayer, setActiveLayer, createText, setFont, setFontSize, setTextAlignment, selectText, setTextDistances, valueDialog, messageBox
 +
|-
 +
|
 +
* [[Automatically Creating a Graph]]
 +
| haveDoc, valueDialog, createLine, setLineWidth, setLineColor, setFillColor, createText, setTextColor, setText, setTextAlignment, setFont, setFontSize, rotateObject
 +
|-
 +
|
 +
* [[Creating a Graph, Part 2]]
 +
| haveDoc, valueDialog, setUnit, createLine, setLineWidth, setLineColor, setFillColor, createText, setTextColor, setText, setTextAlignment, setFont, setFontSize
 +
|-
 +
|
 +
* [[Advanced Graphing]]
 +
| fileDialog, haveDoc, setUnit, valueDialog, createLine, setLineWidth, setLineColor, setFillColor, createPolyLine
 +
|-
 +
|
 +
* [[Making a Pie Chart]]
 +
| valueDialog, messageBox, haveDoc, importSVG – ''much of the script involves mathematical calculations''
 +
|-
 +
|
 +
* [[Import an image in the way office-programs do]]
 +
| getPageSize, fileDialog, createImage, setScaleImageToFrame, setFillColor, setLineColor, getImageScale, sizeObject, haveDoc, messageBox<br>''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.''
 +
|-
 +
|
 +
* [[Drawing a grid]]
 +
| messageBox, createLine, setLineColor, haveDoc, statusMessage, progressReset<br>''There is a minor usage of Scribus commands here, but it does show how to set up a Tkinter dialog for multiple variable entry.''
 +
|-
 +
|
 +
* [[Importing addresses from a text file]]
 +
| newDoc, newPage, createText, setText, setTextAlignment, setFont, setFontSize<br>''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.''
 +
|-
 +
|
 +
* [[Scale an Image to Fill a Frame Proportionally]]
 +
| haveDoc, selectionCount, getSelectedObject, setScaleImageToFrame, getImageScale, scaleImage, docChanged
 +
|-
 +
|
 +
* [[Align an Image in its Frame]]
 +
|-
 +
|
 +
* [[Image Wizard: Scale and Align an Image]]
 +
|-
 +
|
 +
* [[Image Wizard Advanced]]
 +
|-
 +
|
 +
* [[Discovering an Item's Properties]]
 +
| ''not sure if this script works''
 +
|-
 +
|
 +
* [[Un-Flip all Selected Items]]
 +
| haveDoc, selectionCount, getSelectedObject, setProperty, moveObject, docChanged
 +
|-
 +
|
 +
* [[Remove Magenta Color]]
 +
| replaceColor, docChanged<br>''This is a "script-let" really, but quickly shows how to change or delete colors in a document. No checking for errors.''
 +
|-
 +
|
 +
* [[Extracting All Text from a Document]]
 +
| haveDoc, fileDialog, messageBox, pageCount, getPageItems, gotoPage, getAllText, getImageFile
 +
|-
 +
|
 +
* [[Convert RGB value to Hex]]
 +
| valueDialog, messageBox<br>''This is a utility that just happens to run in Scribus, using the valueDialog and messageBox to do what the title says.''
 +
|-
 +
|
 +
* [[Color Chart]]
 +
| 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
 +
|-
 +
|
 +
* [[Book Spine Calculator]]
 +
| messageBox, valueDialog
 +
|-
 +
|
 +
* [[create tables out of csv data]]
 +
|-
 +
|
 +
* [[Reduce the size of Scribus generated PDFs]]
 +
|-
 +
|
 +
* [[Convert Typewriter Quotes to Typographic Quotes]]
 +
|-
 +
|
 +
* [[Autoquote2]] &ndash; a new and improved Autoquote.py
 +
|}
 +
 +
==Basic scripts==
 +
 +
Scripts which give you ideas how you can solve your tasks.
 +
 +
* [[Poor man's mail merge]]
 +
 +
==Full functional scripts==
 +
 +
Scripts that are ready for achieving specific tasks
 +
 +
* [[Export all text|Export all text]] from a Scribus file
 +
* [[Script Resize selected objects|Resize selected objects]]
 +
* [[formatxml|Import xml and apply styles]]
 +
* [[align_to_left_page_margin|Align to the left page margin]] (after adding a new page in a double page document)
 +
* [[Bullets]]. Make bulleted list.
 +
 +
==Scripting new Scribus' functions==
 +
 +
Scripts which sketch new features which may be included in future releases of Scribus
 +
 +
* [[Adjust a text frame to fit its content|Adjust the text frame size according to various factors]]
 +
 +
== Extension scripts and PyQt ==
 +
 +
* [[Extension script discussion]]
 +
* [[Experimental PyQt projects]]
 +
 +
== Python issues ==
 +
 +
* [[Known Scripter Issues]]
 +
 +
= Other =
 +
* [[Extension_script_repository ]]
 +
* [[Web optimised PDF]] &mdash; learn how to minimize PDF size, make your life easier with the included Perl script
 +
* [[Imagemagick Imposition]] &ndash; a bash script doing simple imposition of PNG files exported from Scribus
 +
* [[Printing_4-up_tickets_to_hard_copy_printer]] Shows a) automatic numbering in text boxes and b) hard-copy printing from script

Revision as of 00:59, 14 January 2011

Other languages: Polski (pl) Portuguese (pt_BR)


Scripter

A new script engine is currently being integrated into Scribus. The next steps will be:

  • get the script engine to work (should already be ok)
  • get the editor to work (i'm stucked there)
  • revise the structure of the API
  • add new functions to the API


Script snippets

This section contains snippets you can use to create your own scripts.

It will feature:

  • reading a file
  • updating a status bar
  • selecting a frame
  • pausing the screen update


Beginners Scripts

Link to Script Scripter commands demonstrated
newDoc, createRect, setCornerRadius, setLineWidth, setFillColor, setLineColor, saveDocAs
newDoc, createLine, setLineWidth, setLineColor, setFillShade, createRect, saveDocAs
newDoc, createEllipse, setLineWidth, setFillColor, setFillShade, saveDocAs, currentPage, setHGuides, messageBox, statusMessage, progressReset
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
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
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

Basic scripts

Scripts which give you ideas how you can solve your tasks.

Full functional scripts

Scripts that are ready for achieving specific tasks

Scripting new Scribus' functions

Scripts which sketch new features which may be included in future releases of Scribus

Extension scripts and PyQt

Python issues

Other

Pages in category "Scripts"

The following 103 pages are in this category, out of 103 total.