<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--Converted with LaTeX2HTML 98.2 beta6 (August 14th, 1998)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>11. findertools --
The finder's Apple Events interface</TITLE>
<META NAME="description" CONTENT="11. findertools --
The finder's Apple Events interface">
<META NAME="keywords" CONTENT="mac">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK REL="STYLESHEET" HREF="mac.css">
<LINK REL="next" HREF="module-mactcp.html">
<LINK REL="previous" HREF="module-macostools.html">
<LINK REL="up" HREF="contents.html">
<LINK REL="next" HREF="module-mactcp.html">
</HEAD>
<BODY bgcolor="#ffffff">
<div class=navigation>
<table align=center width="100%" cellpadding=0 cellspacing=2>
<tr>
<td><A HREF="module-mactcp.html"><img width=32 height=32 align=bottom border=0 alt="next"
 src="../icons/next.gif"></A></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="up"
 src="../icons/up.gif"></A></td>
<td><A HREF="module-macostools.html"><img width=32 height=32 align=bottom border=0 alt="previous"
 src="../icons/previous.gif"></A></td>
<td align=center bgcolor="#99CCFF" width="100%">
 <b class=title>Macintosh Library Modules</b></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="contents"
 src="../icons/contents.gif"></A></td>
<td><a
 href="modindex.html"><img width=32 height=32 align=bottom border=0 alt="modules"
 src="../icons/modules.gif"></a></td>
<td><A HREF="genindex.html"><img width=32 height=32 align=bottom border=0 alt="index"
 src="../icons/index.gif"></A></td>
</tr></table><b class=navlabel>Next:</b> <span class=sectref><A HREF="module-mactcp.html">12. mactcp  </A></span>
<b class=navlabel>Up:</b> <span class=sectref><A HREF="contents.html">Contents</A></span>
<b class=navlabel>Previous:</b> <span class=sectref><A HREF="module-macostools.html">10. macostools  </A></span>
<br><hr></div>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION0021100000000000000000">
11. <tt class=module>findertools</tt> --
         The <b class=program>finder</b>'s Apple Events interface</A>
</H1>

<P>
  
<p class=availability>Availability: <span
 class=platform>Macintosh</span>.</p>

<P>
This module contains routines that give Python programs access to some
functionality provided by the finder. They are implemented as wrappers
around the AppleEvent<a name="l2h-160"></a> interface to the finder.

<P>
All file and folder parameters can be specified either as full
pathnames or as FSSpec objects.

<P>
The <tt class=module>findertools</tt> module defines the following functions:

<P>
<dl><dt><b><a name="l2h-153"><tt class=function>launch</tt></a></b> (<var>file</var>)
<dd>
Tell the finder to launch <var>file</var>. What launching means depends on the file:
applications are started, folders are opened and documents are opened
in the correct application.
</dl>

<P>
<dl><dt><b><a name="l2h-154"><tt class=function>Print</tt></a></b> (<var>file</var>)
<dd>
Tell the finder to print a file (again specified by full pathname or
FSSpec). The behaviour is identical to selecting the file and using
the print command in the finder.
</dl>

<P>
<dl><dt><b><a name="l2h-155"><tt class=function>copy</tt></a></b> (<var>file, destdir</var>)
<dd>
Tell the finder to copy a file or folder <var>file</var> to folder
<var>destdir</var>. The function returns an Alias object pointing to
the new file.
</dl>

<P>
<dl><dt><b><a name="l2h-156"><tt class=function>move</tt></a></b> (<var>file, destdir</var>)
<dd>
Tell the finder to move a file or folder <var>file</var> to folder
<var>destdir</var>. The function returns an Alias object pointing to
the new file.
</dl>

<P>
<dl><dt><b><a name="l2h-157"><tt class=function>sleep</tt></a></b> ()
<dd>
Tell the finder to put the Macintosh to sleep, if your machine
supports it.
</dl>

<P>
<dl><dt><b><a name="l2h-158"><tt class=function>restart</tt></a></b> ()
<dd>
Tell the finder to perform an orderly restart of the machine.
</dl>

<P>
<dl><dt><b><a name="l2h-159"><tt class=function>shutdown</tt></a></b> ()
<dd>
Tell the finder to perform an orderly shutdown of the machine.
</dl><p>
<div class=navigation><hr><table align=center width="100%" cellpadding=0 cellspacing=2>
<tr>
<td><A HREF="module-mactcp.html"><img width=32 height=32 align=bottom border=0 alt="next"
 src="../icons/next.gif"></A></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="up"
 src="../icons/up.gif"></A></td>
<td><A HREF="module-macostools.html"><img width=32 height=32 align=bottom border=0 alt="previous"
 src="../icons/previous.gif"></A></td>
<td align=center bgcolor="#99CCFF" width="100%">
 <b class=title>Macintosh Library Modules</b></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="contents"
 src="../icons/contents.gif"></A></td>
<td><a
 href="modindex.html"><img width=32 height=32 align=bottom border=0 alt="modules"
 src="../icons/modules.gif"></a></td>
<td><A HREF="genindex.html"><img width=32 height=32 align=bottom border=0 alt="index"
 src="../icons/index.gif"></A></td>
</tr></table><b class=navlabel>Next:</b> <span class=sectref><A HREF="module-mactcp.html">12. mactcp  </A></span>
<b class=navlabel>Up:</b> <span class=sectref><A HREF="contents.html">Contents</A></span>
<b class=navlabel>Previous:</b> <span class=sectref><A HREF="module-macostools.html">10. macostools  </A></span>
</div>
<!--End of Navigation Panel-->
<ADDRESS>
<hr>Send comments on this document to <a href="mailto:python-docs@python.org">python-docs@python.org</a>.
</ADDRESS>
</BODY>
</HTML>
