The macros feature allows user interaction to be recorded and subsequently played back to repeat the actions that were performed. Recorded macros can be saved so they may be reloaded and reused at a later date.
Design activity as well as dialog interaction can be recorded and replayed.
How to use Macros
All the commands for working with macros are available from the Macros entry in the Tools menu accessed from the main Menubar. The commands are also available for quick access from the Macros toolbar and may also be assigned to a keyboard shortcut key.
The first stage of the process is to record the actions you wish the macro to encapsulate. Select the start macro recording command then perform the actions as you would normally. Once you have completed them, simply select the end macro recording command.
The macro you have recorded becomes the current macro and may be run immediately by using the run macro command. It can be run as many time as you wish simply by repeatedly using the run macro command.
You can also save the recorded macro to be used at a later date using the save macro command.
Use the load macro command to read in a previously saved macro. Once loaded it becomes the current macro and can be run using the run macro command.
If the current macro has been loaded or saved, its name will be shown by the Run Macro menu item and toolbar button tooltip. If it has just been recorded and not yet saved no name will be shown.
Recording a Macro
Start Macro Recording
Default Keys: None
Default Menu: Tools>Macros>Record Macro>Start
Command: Record Macro
Once the start macro recording option has been selected, all subsequent mouse actions, menu and toolbar options and dialog responses will be recorded by the macro.
End Macro Recording
Default Keys: None
Default Menu: Tools>Macros>Record Macro>End
Command: End Record Macro
When you have completed all the actions you wish to record, select the end macro recording option. The macro you have just recorded will become the current macro and can be run immediately.
Cancel Macro Recording
Default Keys: None
Default Menu: Tools>Macros>Record Macro>Cancel
Command: Cancel Record Macro
Select this option if you wish to cancel the macro you are recording. The macro will be discarded and the current macro will remain unaffected.
Running a Macro
Run Macro
Default Keys: None
Default Menu: Tools>Macros>Run Macro {Macro Name}
Command: Run Macro
Selecting this option will run the current macro.
If the Relative Replay option is enabled and the mouse cursor is outside the design window, you are required to set the relative start position using the mouse before the macro will run.
Once running, a macro can be aborted at any time, by pressing the Escape key on the keyboard. Any completed actions may be reversed using the standard undo mechanism.
Saving a Macro
Default Keys: None
Default Menu: Tools>Macros>Save Macro
Command: Save Macro
This option allows you to save the current macro. A dialog similar to the standard Save As dialog will be displayed, which by default, will save the macro to the most recently used macros folder. Once saved, the name of the current macro will be shown by the Run Macro menu item.
Loading a Macro
Default Keys: None
Default Menu: Tools>Macros>Load Macro
Command: Load Macro
Use this option to load a previously saved macro. The Load Macro dialog lists all the saved macros in the defined macros folders. The loaded macro becomes the current macro and its name will be shown by the Run Macro menu item which can be used to invoke it.
If you select the Run button on the dialog rather than than Load button the macro will be loaded and run immediately without having to subsequently select the Run Macro command.
The Folders button allows the currently defined list of macros folders to be reviewed and modified.
Macro Options
Default Keys: None
Default Menu: Tools>Options
Command: Macro Options
Options that affect the recording and replaying of macros can be found on the Macros page of the Options dialog.
The Macros Toolbar
The Macros toolbar provides quick and easy access to all the macro commands.
To be able to start or stop recording/replaying a macro when a dialog is displayed the Macros toolbar must be displayed in floating mode. Normally, when a ‘modal’ dialog is active, all menus and toolbars become inaccessible, but a floating Macros toolbar will remain accessible to allow the macro functions to be used in conjunction with the active dialog. If the Macros toolbar is docked it will become inaccessible like all other toolbars while a ‘modal’ dialog is active.
Running a Macro from a Shortcut Key
As well as being able to assign the Run Macro command to a shortcut key to run the current macro, it is also possible to run a specific saved macro from a chosen shortcut key.
To achieve this, it is first necessary to add the named macro as a User Tool using the Tools tab in the Customise dialog. A quick way to access this is by, from the main menu, selecting Tools, User Tools and Add Tool….
Once defined as a user tool, the macro can be assigned to a shortcut key in the normal way using the Keyboard tab in the Customise dialog, and selecting User Tools from the Category drop-down list.
Running a Macro from Windows Explorer
It is also possible to run a macro from outside the Pulsonix application using Windows Explorer. Simply browse to the appropriate folder and double-click on the file in which the macro is saved. If Pulsonix is running and able, it will run the selected macro. If Pulsonix is not already running it will be started and then immediately run the macro.
Macro Context
It is important to note that a macro records the actions you make but not the entire state of the application and design for every command that is performed. It therefore up to you to make sure that the application state at the time a macro is run is compatible with the actions recorded and while not necessarily having to be identical, any differences are ones which you intend.
For example, say you record a macro that adds a standard piece of text at a predefined position in a design. When you run the macro in a different design, the text style used will be the one defined as the default text style in that design not the design in which the macro was recorded. If you want the text to be always added with a given text style, you must include explicitly setting the text style (using the Change Style dialog), when recording the macro.
When running a macro, if an incompatible issue is encountered, an error will be reported and the macro will terminate. Any already completed actions may be reversed using the standard undo mechanism.
When the Run Macro command is used, a check is made that the current design context matches that of the macro when it was recorded, i.e. are you are trying to run a macro recorded in a PCB design, in a Schematic design? While this situation is not prohibited, if it is detected you will be asked to confirm that this is what you intend.
Using Macros in Dialogs
Providing the Macros toolbar is accessible, it is possible to record or replay a macro while a ‘modal’ dialog is active. So, as well as being able to record a complete dialog interaction, one particular section may be recorded and subsequently replayed in situ in the dialog whenever required.
For example, you could record a macro to just set the information on the Pads page of the Footprint Wizard to specific values, without affecting any of the other pages of the wizard, leaving them to be completed as normal.
Non-Recordable Functionality
Currently, the Customise functionality can not be recorded and replayed by a Macro.