Sophie

Sophie

distrib > Momonga > development > i686 > media > os > by-pkgid > 4491a32356d36140f3fa915c83d8b177 > files > 1583

scribus-doc-1.4.5-2m.mo8.noarch.rpm

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<title>Scripting Scribus with Python</title>
</head>
<body>
<h2>Scripting Scribus with Python</h2>

<h3>Overview</h3>
<p>This is the description how to use the scripting plug-in for Scribus. The Scripter allows you to use the powerful Python programming language as a scripting language in Scribus. This can help you to automate otherwise repetitive tasks or add new features.</p>

<p>Note that additions to the Scripter are being made frequently, which means that the available documentation may be incomplete.</p>


<h3>Using the Plug-in</h3>
<p>Scribus is being shipped with some &ldquo;hard-wired&rdquo; scripts, which are available via <i>Scripter&nbsp;&gt; Scribus Scripts</i>:</p>

<table width="100%"><tr><td align="center"><img src="images/Scripter.png" align="center" alt="Running a script" title="Running a script" /></td></tr></table>

<p>There are some simple example scripts in the subdirectory &ldquo;samples.&rdquo; Its location depends on the operating system you use, e.g. <code>/usr/local/share/scribus</code> or <code>/usr/share/scribus</code> on Linux. If you have created a script which you think could be useful for others, please feel free to add it to the <a href="http://wiki.scribus.net/">Scribus Wiki</a> or paste it into an email and send it to the <a href="http://lists.scribus.info/mailman/listinfo/scribus/">Scribus mailing list</a>.</p>

<p>To execute an external Python script, you have to use <i>Script&nbsp;&gt; Execute Script</i>. Scribus will open a file dialog, which allows you to select a Python script (file extension: *.py). <i>Script&nbsp;&gt; Recent Scripts</i> shows a list of recently executed scripts.</p> 

<p>You can use many Python modules with this plug-in, the only exception being scripts that expect parameters from the command Line. These won&rsquo;t work because the plug-in gives the Python interpreter an empty command line.</p>

<p>The menu entry <i>Script&nbsp;&gt; Show Console</i> will launch an interactive Python console, where you can execute commands directly. There is no need to use &ldquo;<code>from scribus import *</code>&rdquo;, as this has already been done. You can use all the commands listed in the following pages of the Scripter API documentation directly without any prefix.</p>
</body>
</html>