| Revision:

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

History | View | Annotate | Download (2 kB)

1 486 mdecorde
2 486 mdecorde
From the edit dialog, you can:<br>
3 486 mdecorde
<ul>reorder commands in the macro</ul>
4 486 mdecorde
<ul>remove commands</ul>
5 486 mdecorde
<ul>add new commands</ul>
6 486 mdecorde
<ul>edit commands that have data associated with them (ex. the Find command).</ul>
7 486 mdecorde
<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 486 mdecorde
<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 486 mdecorde
<h3>Special macro helper commands</h3>
10 486 mdecorde
<ul>Mark selection start - set a 'mark' at the current selection start, or at the caret pos if no selection</ul>
11 486 mdecorde
<ul>Mark selection end - set a 'mark' at the current selection end, or at the caret pos if no selection</ul>
12 486 mdecorde
<ul>Move cursor to mark - Set the editor cursor to the current mark position</ul>
13 486 mdecorde
<ul>Insert string - this is the workhorse command used to add text. Can contain carriage returns.</ul>
14 486 mdecorde
<ul>Find - perform various kinds of text searching</ul>
15 486 mdecorde
<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 486 mdecorde
<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 486 mdecorde
18 486 mdecorde
The Mark commands are provided as a way to maintain some state while other operations are performed without requiring scripting.
19 486 mdecorde
For example, to comment a selected area, you could record a sequence of commands like:
20 486 mdecorde
<ol>mark selection start</ol>
21 486 mdecorde
<ol>move cursor right (puts cursor at end of selection</ol>
22 486 mdecorde
<ol>insert string "*/"</ol>
23 486 mdecorde
<ol>move cursor to mark</ol>
24 486 mdecorde
<ol>insert string "/*"</ol>
25 486 mdecorde
26 486 mdecorde