Statistics
| Revision:

root / tmp / org.txm.practically.rcp / doc / macroEdit.html @ 486

History | View | Annotate | Download (2 kB)

1
<html>
2
From the edit dialog, you can:<br>
3
<ul>reorder commands in the macro</ul>
4
<ul>remove commands</ul>
5
<ul>add new commands</ul>
6
<ul>edit commands that have data associated with them (ex. the Find command).</ul>
7
<br>The Edit dialog also allows you to add a new macro id to a command that didn't previously have an associated id (thus turning it into a persistent command), or alter (or remove) the id of an existing command.
8
<br>Adding new commands to the macro requires that you have some knowledge of the commands.  There is a filter above the <bold>Available Commands</bold> list that defaults to showing only edit commands (based on looking at categories).  Some commands are not appropriate to a macro, but it's impossible for me to tell what they are, so you may have to experiment.
9
<h3>Special macro helper commands</h3>
10
<ul>Mark selection start - set a 'mark' at the current selection start, or at the caret pos if no selection</ul>
11
<ul>Mark selection end - set a 'mark' at the current selection end, or at the caret pos if no selection</ul>
12
<ul>Move cursor to mark - Set the editor cursor to the current mark position</ul>
13
<ul>Insert string - this is the workhorse command used to add text. Can contain carriage returns.</ul>
14
<ul>Find - perform various kinds of text searching</ul>
15
<ul>Styled Text commands - These are commands I've added to the system since they aren't commands by default.  Actions like "move cursor right" are supported by the StyledText widget but aren't mapped as key bindings.</ul>
16
<ul>Macro script - You can write whatever scripts you'd like using beanshell.  I pass in several variables for the editor that should be useful.</ul>
17
<br>
18
The Mark commands are provided as a way to maintain some state while other operations are performed without requiring scripting.  
19
For example, to comment a selected area, you could record a sequence of commands like:
20
<ol>mark selection start</ol>
21
<ol>move cursor right (puts cursor at end of selection</ol>
22
<ol>insert string "*/"</ol>
23
<ol>move cursor to mark</ol>
24
<ol>insert string "/*"</ol>
25

    
26
</html>