Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 51f7de0838007e2876221e819c82d833 > files > 599

sketch-0.6.13-2mdk.ppc.rpm

<html>
<head>
<title>User's Guide: User Scripting
</title>
</head>
<body bgcolor=white text=black link=blue vlink=navy alink=red>
<TABLE WIDTH="100%">
<TR>
<TH ALIGN="left" WIDTH="33%"><img SRC="Images/arrow-left.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Prev"></TH>
<TH ALIGN="center" WIDTH="33%"><img SRC="Images/arrow-up.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Up"></TH>
<TH ALIGN="right" WIDTH="33%"><img SRC="Images/arrow-right.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Next"></TH>
</TR>
<TR>
<TD ALIGN="left"><A HREF="usersguide-4.html">Configuration
</A></TD>
<TD ALIGN="center"><A HREF="usersguide.html">User's Guide</A></TD>
<TD ALIGN="right"></TD>
</TR>
</TABLE>
<HR NOSHADE>
<H1><FONT face="Helvetica,Arial"><A NAME="N1"></A>User Scripting
</font></H1>

<P>Sketch lets you write scripts to automate tasks and add new
functionality. The programming language for these scripts is Python, an
interpreted, object oriented language.</P>
<P>This chapter explains how to write such scripts and how they end up in
the <b>Scripts</b> menu, so that you can invoke them. I'll assume that
you already know how to program in Python. If you don't know that yet,
have a look at <A HREF="http://www.python.org">Python's web-page</A> for
online documentation.</P>
<P>Some parts of this feature are still experimental and may change
substantially in newer releases, so watch the NEWS file and the sample
scripts in case this documentation is outdated.</P>
<P>Sketch itself is implemented almost completely in Python, so your
scripts have access to all areas of the application, including internal
data structures. This makes user scripts very powerful, but it also
means that they can mess around with Sketch's internals with the
result that Sketch might not be able to undo the changes or even save
the document. But don't worry, evading the traps is not that difficult
(I think) and this chapter tries to explain to avoid them.</P>

<H4><FONT face="Helvetica,Arial"><img SRC="Images/bullet.png" WIDTH="9" HEIGHT="9"><A HREF="usersguide-6.html">Introduction</A></font></H4>
<H4><FONT face="Helvetica,Arial"><img SRC="Images/bullet.png" WIDTH="9" HEIGHT="9"><A HREF="usersguide-7.html">The Example Scripts</A></font></H4>
<H4><FONT face="Helvetica,Arial"><img SRC="Images/bullet.png" WIDTH="9" HEIGHT="9"><A HREF="usersguide-8.html">The Script Registry
</A></font></H4>
<H4><FONT face="Helvetica,Arial"><img SRC="Images/bullet.png" WIDTH="9" HEIGHT="9"><A HREF="usersguide-9.html">Sketch's API
</A></font></H4>
<H4><FONT face="Helvetica,Arial"><img SRC="Images/bullet.png" WIDTH="9" HEIGHT="9"><A HREF="usersguide-10.html">Common Tasks</A></font></H4>
<HR NOSHADE>
<TABLE WIDTH="100%">
<TR>
<TD ALIGN="left"><A HREF="usersguide-4.html">Configuration
</A></TD>
<TD ALIGN="center"><A HREF="usersguide.html">User's Guide</A></TD>
<TD ALIGN="right"></TD>
</TR>
<TR>
<TH ALIGN="left" WIDTH="33%"><img SRC="Images/arrow-left.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Prev"></TH>
<TH ALIGN="center" WIDTH="33%"><img SRC="Images/arrow-up.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Up"></TH>
<TH ALIGN="right" WIDTH="33%"><img SRC="Images/arrow-right.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Next"></TH>
</TR>
</TABLE>
</body>
</html>