PageRenderTime 26ms CodeModel.GetById 16ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms


HTML | 64 lines | 64 code | 0 blank | 0 comment | 0 complexity | 1885a57daa94097b1ede185fbd66c54c MD5 | raw file
 1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Recording Macros</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="jEdit 4.2 User's Guide"><link rel="up" href="using-macros.html" title="Chapter 8. Using Macros"><link rel="previous" href="using-macros.html" title="Chapter 8. Using Macros"><link rel="next" href="running-macros.html" title="Running Macros"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Recording Macros</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="using-macros.html">Prev</a> </td><th width="60%" align="center">Chapter 8. Using Macros</th><td width="20%" align="right"> <a accesskey="n" href="running-macros.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="recording-macros"></a>Recording Macros</h2></div></div><div></div></div><p>
 2     The simplest use of macros is to record a series of key strokes and
 3     menu commands as a BeanShell script, and play them back later.
 4     While this doesn't let you take advantage of the full power of
 5     BeanShell, it is still a great time saver and can even be used to
 6     &#8220;<span class="quote">prototype</span>&#8221; more complicated macros.
 7  </p><p>
 8    <span><b class="guimenu">Macros</b></span>&gt;<span><b class="guimenuitem">Record Macro</b></span>
 9    (shortcut: <tt class="keycap">C+m C+r</tt>) prompts
10    for a macro name and begins recording.
11  </p><p>
12    While recording is in progress, the string &#8220;<span class="quote">Macro
13    recording</span>&#8221; is displayed in the status bar. jEdit records the
14    following:
15  </p><div class="itemizedlist"><ul type="disc"><li><p>Key strokes</p></li><li><p>Menu item commands</p></li><li><p>Tool bar clicks</p></li><li><p>All search and replace operations, except incremental
16    search</p></li></ul></div><p>
17   Mouse clicks in the text area are <span class="emphasis"><em>not</em></span> recorded;
18   use text selection commands or arrow keys instead.
19  </p><p>
20   <span><b class="guimenu">Macros</b></span>&gt;<span><b class="guimenuitem">Stop Recording</b></span>
21   (shortcut: <tt class="keycap">C+m C+s</tt>) stops
22   recording. It also switches to the buffer containing the recorded macro,
23   giving you a chance to check over the recorded commands and make any
24   necessary changes. When you are happy with the macro, save the buffer and it
25   will appear in the <span><b class="guimenu">Macros</b></span> menu. To discard the macro,
26   close the buffer without saving it.
27  </p><p>
28   The file name extension <tt class="filename">.bsh</tt> is
29   automatically appended to the macro name, and all spaces are converted
30   to underscore characters, in order to make the macro name a valid file
31   name. These two operations are reversed when macros are displayed in the
32   <span><b class="guimenu">Macros</b></span> menu; see <a href="organizing-macros.html" title="How jEdit Organizes Macros">the section called &#8220;How jEdit Organizes Macros&#8221;</a>
33   for details.
34  </p><p>
35   If a complicated operation only needs to be repeated a few
36   times, using the temporary macro feature is quicker than saving a new
37   macro file.
38  </p><p>
39   <span><b class="guimenu">Macros</b></span>&gt;<span><b class="guimenuitem">Record Temporary
40   Macro</b></span> (shortcut: <tt class="keycap">C+m C+m</tt>) begins
41   recording to a buffer named <tt class="filename">Temporary_Macro.bsh</tt>.
42   Once recording of a temporary macro is complete, jEdit does not display
43   the buffer containing the recorded commands, but the name
44   <tt class="filename">Temporary_Macro.bsh</tt> will be visible on any list of
45   open buffers. By switching to that buffer, you can view the commands,
46   edit them, and save them if you wish to
47   a permanent macro file. Whether or not you look at or save the temporary
48   macro contents, it is immediately available for playback.
49  </p><p>
50   <span><b class="guimenu">Macros</b></span>&gt;<span><b class="guimenuitem">Run Temporary
51   Macro</b></span> (shortcut: <tt class="keycap">C+m C+p</tt>) plays
52   the macro recorded to the <tt class="filename">Temporary_Macro.bsh</tt> buffer.
53  </p><p>
54    Only one temporary macro is available at a time. If you begin recording
55    a second temporary macro, the first is erased and cannot be recovered
56    unless you have saved the contents to a file with a name other than
57    <tt class="filename">Temporary_Macro.bsh</tt>.
58    If you do not save the temporary macro, you must keep the buffer
59    containing the macro script open during your jEdit session. To have the
60    macro available for your next jEdit session, save the buffer
61    <tt class="filename">Temporary_Macro.bsh</tt> as an ordinary macro with a
62    descriptive name of your choice. The new name will then be displayed in
63    the <span><b class="guimenu">Macros</b></span> menu.
64  </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="using-macros.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="using-macros.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="running-macros.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 8. Using Macros </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Running Macros</td></tr></table></div></body></html>