| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="mac.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="mac.html" title='Macintosh Library Modules' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='index' href='genindex.html' title='Index' /> |
| 10 | <link rel='last' href='about.html' title='About this document...' /> |
| 11 | <link rel='help' href='about.html' title='About this document...' /> |
| 12 | <link rel="next" href="module-EasyDialogs.html" /> |
| 13 | <link rel="prev" href="module-macostools.html" /> |
| 14 | <link rel="parent" href="macpython-modules.html" /> |
| 15 | <link rel="next" href="module-EasyDialogs.html" /> |
| 16 | <meta name='aesop' content='information' /> |
| 17 | <title>2.6 findertools -- The finder's Apple Events interface</title> |
| 18 | </head> |
| 19 | <body> |
| 20 | <DIV CLASS="navigation"> |
| 21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 23 | <tr> |
| 24 | <td class='online-navigation'><a rel="prev" title="2.5 macostools " |
| 25 | href="module-macostools.html"><img src='../icons/previous.png' |
| 26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 27 | <td class='online-navigation'><a rel="parent" title="2. MacPython Modules" |
| 28 | href="macpython-modules.html"><img src='../icons/up.png' |
| 29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 30 | <td class='online-navigation'><a rel="next" title="2.7 EasyDialogs " |
| 31 | href="module-EasyDialogs.html"><img src='../icons/next.png' |
| 32 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 33 | <td align="center" width="100%">Macintosh Library Modules</td> |
| 34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 35 | href="contents.html"><img src='../icons/contents.png' |
| 36 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 38 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 39 | <td class='online-navigation'><a rel="index" title="Index" |
| 40 | href="genindex.html"><img src='../icons/index.png' |
| 41 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 42 | </tr></table> |
| 43 | <div class='online-navigation'> |
| 44 | <b class="navlabel">Previous:</b> |
| 45 | <a class="sectref" rel="prev" href="module-macostools.html">2.5 macostools </A> |
| 46 | <b class="navlabel">Up:</b> |
| 47 | <a class="sectref" rel="parent" href="macpython-modules.html">2. MacPython Modules</A> |
| 48 | <b class="navlabel">Next:</b> |
| 49 | <a class="sectref" rel="next" href="module-EasyDialogs.html">2.7 EasyDialogs </A> |
| 50 | </div> |
| 51 | <hr /></div> |
| 52 | </DIV> |
| 53 | <!--End of Navigation Panel--> |
| 54 | |
| 55 | <H1><A NAME="SECTION004600000000000000000"> |
| 56 | 2.6 <tt class="module">findertools</tt> -- |
| 57 | The <b class="program">finder</b>'s Apple Events interface</A> |
| 58 | </H1> |
| 59 | |
| 60 | <P> |
| 61 | <A NAME="module-findertools"></A> |
| 62 | <p class="availability">Availability: <span |
| 63 | class="platform">Macintosh</span>.</p> |
| 64 | |
| 65 | <P> |
| 66 | This module contains routines that give Python programs access to some |
| 67 | functionality provided by the finder. They are implemented as wrappers |
| 68 | around the AppleEvent<a id='l2h-79' xml:id='l2h-79'></a> interface to the finder. |
| 69 | |
| 70 | <P> |
| 71 | All file and folder parameters can be specified either as full |
| 72 | pathnames, or as <tt class="class">FSRef</tt> or <tt class="class">FSSpec</tt> objects. |
| 73 | |
| 74 | <P> |
| 75 | The <tt class="module">findertools</tt> module defines the following functions: |
| 76 | |
| 77 | <P> |
| 78 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 79 | <td><nobr><b><tt id='l2h-72' xml:id='l2h-72' class="function">launch</tt></b>(</nobr></td> |
| 80 | <td><var>file</var>)</td></tr></table></dt> |
| 81 | <dd> |
| 82 | Tell the finder to launch <var>file</var>. What launching means depends on the file: |
| 83 | applications are started, folders are opened and documents are opened |
| 84 | in the correct application. |
| 85 | </dl> |
| 86 | |
| 87 | <P> |
| 88 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 89 | <td><nobr><b><tt id='l2h-73' xml:id='l2h-73' class="function">Print</tt></b>(</nobr></td> |
| 90 | <td><var>file</var>)</td></tr></table></dt> |
| 91 | <dd> |
| 92 | Tell the finder to print a file. The behaviour is identical to selecting the file and using |
| 93 | the print command in the finder's file menu. |
| 94 | </dl> |
| 95 | |
| 96 | <P> |
| 97 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 98 | <td><nobr><b><tt id='l2h-74' xml:id='l2h-74' class="function">copy</tt></b>(</nobr></td> |
| 99 | <td><var>file, destdir</var>)</td></tr></table></dt> |
| 100 | <dd> |
| 101 | Tell the finder to copy a file or folder <var>file</var> to folder |
| 102 | <var>destdir</var>. The function returns an <tt class="class">Alias</tt> object pointing to |
| 103 | the new file. |
| 104 | </dl> |
| 105 | |
| 106 | <P> |
| 107 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 108 | <td><nobr><b><tt id='l2h-75' xml:id='l2h-75' class="function">move</tt></b>(</nobr></td> |
| 109 | <td><var>file, destdir</var>)</td></tr></table></dt> |
| 110 | <dd> |
| 111 | Tell the finder to move a file or folder <var>file</var> to folder |
| 112 | <var>destdir</var>. The function returns an <tt class="class">Alias</tt> object pointing to |
| 113 | the new file. |
| 114 | </dl> |
| 115 | |
| 116 | <P> |
| 117 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 118 | <td><nobr><b><tt id='l2h-76' xml:id='l2h-76' class="function">sleep</tt></b>(</nobr></td> |
| 119 | <td><var></var>)</td></tr></table></dt> |
| 120 | <dd> |
| 121 | Tell the finder to put the Macintosh to sleep, if your machine |
| 122 | supports it. |
| 123 | </dl> |
| 124 | |
| 125 | <P> |
| 126 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 127 | <td><nobr><b><tt id='l2h-77' xml:id='l2h-77' class="function">restart</tt></b>(</nobr></td> |
| 128 | <td><var></var>)</td></tr></table></dt> |
| 129 | <dd> |
| 130 | Tell the finder to perform an orderly restart of the machine. |
| 131 | </dl> |
| 132 | |
| 133 | <P> |
| 134 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 135 | <td><nobr><b><tt id='l2h-78' xml:id='l2h-78' class="function">shutdown</tt></b>(</nobr></td> |
| 136 | <td><var></var>)</td></tr></table></dt> |
| 137 | <dd> |
| 138 | Tell the finder to perform an orderly shutdown of the machine. |
| 139 | </dl> |
| 140 | |
| 141 | <DIV CLASS="navigation"> |
| 142 | <div class='online-navigation'> |
| 143 | <p></p><hr /> |
| 144 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 145 | <tr> |
| 146 | <td class='online-navigation'><a rel="prev" title="2.5 macostools " |
| 147 | href="module-macostools.html"><img src='../icons/previous.png' |
| 148 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 149 | <td class='online-navigation'><a rel="parent" title="2. MacPython Modules" |
| 150 | href="macpython-modules.html"><img src='../icons/up.png' |
| 151 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 152 | <td class='online-navigation'><a rel="next" title="2.7 EasyDialogs " |
| 153 | href="module-EasyDialogs.html"><img src='../icons/next.png' |
| 154 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 155 | <td align="center" width="100%">Macintosh Library Modules</td> |
| 156 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 157 | href="contents.html"><img src='../icons/contents.png' |
| 158 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 159 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 160 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 161 | <td class='online-navigation'><a rel="index" title="Index" |
| 162 | href="genindex.html"><img src='../icons/index.png' |
| 163 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 164 | </tr></table> |
| 165 | <div class='online-navigation'> |
| 166 | <b class="navlabel">Previous:</b> |
| 167 | <a class="sectref" rel="prev" href="module-macostools.html">2.5 macostools </A> |
| 168 | <b class="navlabel">Up:</b> |
| 169 | <a class="sectref" rel="parent" href="macpython-modules.html">2. MacPython Modules</A> |
| 170 | <b class="navlabel">Next:</b> |
| 171 | <a class="sectref" rel="next" href="module-EasyDialogs.html">2.7 EasyDialogs </A> |
| 172 | </div> |
| 173 | </div> |
| 174 | <hr /> |
| 175 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 176 | </DIV> |
| 177 | <!--End of Navigation Panel--> |
| 178 | <ADDRESS> |
| 179 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 180 | </ADDRESS> |
| 181 | </BODY> |
| 182 | </HTML> |