Macro Scheduler 15

Create Exe

If you have the Professional edition installed this option will create a standalone executable version of the highlighted script.  Some functions require runtime library files which must be in the same folder as your .exe.  See "Runtime Libraries" below for details.


Output file:

The compiler will prompt for an output exe file.  By default the exe will have the same name and path as the script being compiled.  You can browse for a different location using the browse button.



As an option a custom icon can be embedded into the compiled executable by selecting an icon (.ico) file.  This is not supported in Windows 95/98.  To compile a custom icon into the executable use Windows NT, 2000, XP or above.



Create Console App

Compile Includes

Creates an EXE which runs as a console app and can write to STDOUT

Scripts referenced by Include> statements will be embedded and compiled into the Exe.  Will not work where Include> references scripts via variables other than SCRIPT_DIR.

Disable Logging

Prevents the Exe from being logged (adds /LOGFILE=\dev\null to Include Parameters)

No System Tray Icon

No system tray icon will be created (adds /NOSYSTRAY to Include Parameters)

Run Hidden

Task bar icon will not be shown (adds /HIDE to Include Parameters)

Disable SHIFT+ESC Stop Key

Prevents SHIFT+ESC being used to stop the Exe (adds /NOSTOPKEY to Include Parameters)

Copy Runtime DLLS

If a command that needs runtime DLLs exists in the script those DLLs will be copied from the program folder to the .exe location

Copy BMP Subfolder

If the script uses image recognition its BMP_DIR (used to store needle images) will be copied to the destination


Include Parameters:

Optionally you can also specify a command line to include in the compiled executable.  This means command line parameters can be "hard-coded" into the executable so that they don't have to be specified on the command line when the executable is run.  Any of the command line options that can be passed into scripts can be included, including parameters to be passed into scripts.  E.g. /HIDE, /NOSYSTRAY, /LOGFILE= and script parameters can be hard coded into the executable. See Command Line Options.


The title of the compiled executable can be modified by setting the APP_TITLE variable in the script or pass it in Include Parameters. The default is "Macro Scheduler".  E.g.:  Let>APP_TITLE=My Program


The executable file created by the compiler can be run on any machine without having to have Macro Scheduler installed, and it will run the script.


Compiling from the command line:

To compile on the command line run msrt.exe as follows:


msrt.exe -COMPILE source.scp target.exe [-QUIET] [-DEL] [-OPTS:options [-ICON:iconfile]]


Optional switches are shown in square brackets and are as follows:


-QUIET will prevent compiler error/success messages being displayed

-DEL deletes the source script file

-OPTS: then a command line to compile into the executable, e.g.: -OPTS:-NOSYSTRAY /parm1=fred

-ICON: then a .ico file to change the default program icon


To compile a console app use msrt_console.exe instead of msrt.exe.


Runtime Libraries


If your script contains any of the text capture functions (GetTextAtPos, GetTextInRect, GetWindowsTextEx, GetTextPos, WaitScreenText) you will need to supply the following files with your .exe:









These files can be found in the Macro Scheduler program folder.  Copy the above files to the same location as your .exe, or use the compiler option.


Stopping Compiled Macros


Unless disabled (see compiler options above) SHIFT-ESC will normally stop a running .exe.  However, since this uses the Windows hotkey system and only one application can "own" a hotkey at a time, if some other application has already registered this hotkey it will fail to stop the .exe.  Also note that Macro Scheduler itself uses this stop key sequence by default, so if you already have Macro Scheduler running and have not changed the stop key sequence under Tools/Options then it will fail to stop the .exe as Macro Scheduler will get it first.  It is unlikely that your users will also be running Macro Scheduler.


Various other options exist for creating your own custom exit methods.  E.g. you could use an OnEvent KEY_DOWN handler in your macro to create your own stop key sequence specific to your macro.  You could even give your users a choice of keystroke combination.  Another example would be a small custom dialog with a stop button.