Statistics
| Revision:

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

 1 2 3 486 mdecorde   486 mdecorde From the edit dialog, you can:
 486 mdecorde 
reorder commands in the macro
 486 mdecorde 
remove commands
 486 mdecorde 
 486 mdecorde 
edit commands that have data associated with them (ex. the Find command).
 486 mdecorde 
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.  486 mdecorde 
Adding new commands to the macro requires that you have some knowledge of the commands. There is a filter above the Available Commands 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.  486 mdecorde 

Special macro helper commands

 486 mdecorde 
Mark selection start - set a 'mark' at the current selection start, or at the caret pos if no selection
 486 mdecorde 
Mark selection end - set a 'mark' at the current selection end, or at the caret pos if no selection
 486 mdecorde 
Move cursor to mark - Set the editor cursor to the current mark position
 486 mdecorde 
Insert string - this is the workhorse command used to add text. Can contain carriage returns.
 486 mdecorde 
Find - perform various kinds of text searching
 486 mdecorde 
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.
 486 mdecorde 
Macro script - You can write whatever scripts you'd like using beanshell. I pass in several variables for the editor that should be useful.
 486 mdecorde 
 486 mdecorde The Mark commands are provided as a way to maintain some state while other operations are performed without requiring scripting.  486 mdecorde For example, to comment a selected area, you could record a sequence of commands like:  486 mdecorde 
mark selection start
 486 mdecorde 
move cursor right (puts cursor at end of selection
 486 mdecorde 
insert string "*/"
 486 mdecorde 
move cursor to mark
 486 mdecorde 
insert string "/*"
 486 mdecorde 486 mdecorde