Debian Codegraph @

docs/manual/History_mechanism.html

raw
1 <html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
2 <title>History mechanism</title>
3 <style>
4 td { padding-left: 5pt; padding-right: 5pt; }
5 th { padding-left: 5pt; padding-right: 5pt; }
6 code { white-space: pre-wrap; }
7 dd { white-space: pre-wrap; }
8 </style>
9 </head><body bgcolor="#FFFFFF">
10
11 <table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b>
12 History mechanism
13 </b></font></table></table>
14 <p>The easiest way to do <a href="Scripting.html">scripting</a>. The <i>history</i> is the sequence of all menu commands (in the Objects or Picture window or in the editors), action commands (in the dynamic menu), or mouse clicks on objects (in the list of objects), that you performed during your Praat session, together with the settings that you specified in the settings windows that popped up as a result of those commands.</p>
15 <h2>Viewing the history</h2>
16 <p>To view your history, you first open a <a href="ScriptEditor.html">ScriptEditor</a> with <a href="New_Praat_script.html">New Praat script</a> or <a href="Open_Praat_script___.html">Open Praat script...</a>. You then choose <a href="Paste_history.html">Paste history</a> from the <b>Edit</b> menu.</p>
17 <h2>Recording a macro</h2>
18 <p>To record a sequence of mouse clicks for later re-use, perform the following steps:</p>
19 <dl>
20 <dd style="position:relative;padding-left:1em;text-indent:-2em">1. Choose <a href="Clear_history.html">Clear history</a> from the <b>Edit</b> menu. This makes the history mechanism forget all previous clicks.</dd>
21 <dd style="position:relative;padding-left:1em;text-indent:-2em">2. Perform the actions that you want to record.</dd>
22 <dd style="position:relative;padding-left:1em;text-indent:-2em">3. Choose <a href="Paste_history.html">Paste history</a> from the <b>Edit</b> menu. Because you cleared the history before you started, the resulting script contains only the actions that you performed in step 2. You can now already re-run the actions that you performed in step 2.</dd>
23 <dd style="position:relative;padding-left:1em;text-indent:-2em">4. You can save the recorded actions to a script file by choosing <b>Save</b> from the <b>File</b> menu.</dd>
24 <dd style="position:relative;padding-left:1em;text-indent:-2em">5. You can put this script file under a button in the <a href="Dynamic_menu.html">dynamic menu</a> by choosing <a href="Add_to_dynamic_menu___.html">Add to dynamic menu...</a> from the File menu, or under a button in a fixed menu by choosing <a href="Add_to_fixed_menu___.html">Add to fixed menu...</a>. This button will be preserved across Praat sessions.</dd>
25 </dl>
26 <p>This macro mechanism is much more flexible than the usual opaque macro mechanism used by most programs, because you can edit the script and make some of the arguments variable by putting them in the <b>form</b> clause at the top of the script. In this way, the script will prompt the user for these arguments, just as with all the menu and action commands that end in the three dots (...). See the <a href="Scripting.html">Scripting</a> tutorial for all the things that you can do in scripts.</p>
27 <h3>Links to this page</h3>
28 <ul>
29 <li><a href="Scripting_2__How_to_script_settings_windows.html">Scripting 2. How to script settings windows</a>
30 <li><a href="What_was_new_in_3_5_.html">What was new in 3.5?</a>
31 </ul>
32 <hr>
33 <address>
34 <p>© ppgb 20040414</p>
35 </address>
36 </body>
37 </html>