How the macro recorder uses the dispatch framework
The macro recorder records the generated dispatches. The recorder is relatively simple to implement and the same commands that are issued are recorded for later use. The problem is that not all dispatched commands are complete. For example, inserting an object generates the following code:
- dispatcher.executeDispatch(document, ".uno:InsertObject", "", 0, Array())
It is not possible to specify what kind of object to create or insert. If an object is inserted from a file, you cannot specify which file to insert.
I recorded a macro and used Tools > Options to open and modify configuration items. The generated macro does not record any configuration changes; in fact, the generated code is commented so it will not even be run.
- rem dispatcher.executeDispatch(document, ".uno:OptionsTreeDialog", "", 0, Array())
If a dialog is opened, the command to open the dialog is likely to be generated. Any work done inside the dialog is not likely to be recorded. Examples include macro organization dialogs, inserting special characters, and similar types of dialogs. Other possible problems using the macro recorder include things such as inserting a formula, setting user data, setting filters in Calc, actions in database forms, and exporting a document to an encrypted PDF file. You never know for certain what will work unless you try it, however. The actions from the search dialog are properly captured, for example.