macro
When performing repetitive tasks, instead of entering each command at the command line, you can enter the commands in a macro and then run the macro.
You can use the macro command to:
- Record all the commands you type into the console to a file.
- Play back a previously recorded macro file (this re-executes all the commands in the macro without you having to type them again).
By default, macros are stored in the SuperADMIN console\macros directory, but you can use the macro command to change this. In a default installation the macros directory is: C:\ProgramData\STR\SuperADMIN\console\macros
You can also write your own macros in a text editor and then play them in the SuperADMIN console: simply save the text file in the macros directory with the file extension .sam
Usage | Description |
---|---|
macro record <name> | Starts recording all commands to the specified macro file. SuperADMIN will save the macro file to the console\macros directory. |
macro stop <name> | Stops recording commands to the specified macro. |
macro stop | Stops recording all macros. |
macro {play|run|exec} <name> | Plays back the specified macro. |
macro directory | Displays the current location of the macros directory. |
macro directory <directory> | Changes the location of the macros directory. You can either enter a full path to the directory or you can enter a path relative to the location of the SuperADMIN console. For example:
|
If you are recording a macro and you use the login
command and enter the username and password when prompted, then those credentials will not be saved to the macro.
To save a login command with credentials, use the short form of the login command (login <username> <password>
).
Using Macro Files from Earlier Releases
From version 9.0 onwards, SuperSTAR provides full Unicode support. This means that SuperSERVER and the SuperSTAR clients fully support all characters and languages, regardless of the character set supported by the user's system codepage or locale.
This change may impact your use of macro files that were created with previous releases. In most cases you will be able to continue using these existing macro files with no issues.
SuperADMIN will attempt to automatically detect the encoding of the macro file. However, in some cases this may not be possible. If this is the case then SuperADMIN displays the following message:
Encoding with BOM can be used to ensure correct encoding detection if needed.
If you see this message, then you are recommended to convert the encoding of your macro files to UTF-8 with a Byte Order Mark (BOM). One way to do this is to use a text editor such as Notepad++. Open the macro file in Notepad++ and select Encoding > Convert to UTF-8.
![](../../__attachments/3748333/Npp-ConvertUTF8.png?inst-v=25b2f5e4-c237-44cc-8a30-98464f991aca)