Skip to main content
Skip table of contents

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

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:

  • The following command sets the macros directory to a location on the D: drive:

    CODE
    macro directory D:\STR\macros
  • The following example sets the macro directory to C:\ProgramData\STR\SuperADMIN\console\macros (assuming that SuperADMIN is installed in the default location):

    CODE
    macro directory macros

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>).

You can use macros to automate tasks in SuperADMIN (the SuperADMIN console has a command line option that will execute a macro on start up). See Automation and SuperADMIN for more information.

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:

TEXT
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.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.