Sample Macros


The Macro Express help file contains comprehensive information on how to use each part of the program. It contains screen shots of almost every element in the program with explanations of how to use each element. There are also many written examples of how to use the commands in macros.

 

We have also included a number of sample macros with the program. This section will briefly review each of these macros. First, to have access to the sample macros, open the Macro Explorer. Then click on "File | Open Macro File" and select the "samples.mex" macro file. With this macro file loaded in, you can see and review any of the sample macros. Click on any of the macros below for a description of what task the macro completes.

 

Floating Menu Using Icons

This sample macro demonstrates how to setup and use a Floating Menu macro. A floating menu macro is simply a toolbar or window that floats on top of all other programs. The toolbar or window contains a list of other macros which you can activate at will by clicking on a macro in the toolbar or window. If you edit this macro, you will be given a list of all the macros available to be put in the floating menu and a list of all the macros that are currently in the floating menu. You can add or take away macros from the menu at will. When editing the macro there is a properties section. This allows you to choose the style of menu, whether it will be a toolbar with icons or a window with text selections.

 

Hide a Program

This sample demonstrates how to hide (make it invisible) a window and how to display it again. It uses the notepad program for its example. It also demonstrates the use of launching a program, using a variable and displaying messages in a text window.

 

Launch Program

This sample demonstrates how to launch a program. It launches the Microsoft Paint program. It also demonstrates the use of If / then / else conditioning by testing to see if the Paint program exists. Displaying messages in a text window is also demonstrated.

 

Maximize and Minimize

This sample demonstrates how to minimize, maximize and restore a window. It uses the notepad program for its example. It also demonstrates the use of launching a program, using variables, activating a window and displaying messages in a text window.

 

Menu and Question

This sample demonstrates how to use a question and a menu of choices in a macro. It asks the user a question and then asks the user to choose from a list of choices. It also demonstrates the use of if / then / else conditioning, using variables and displaying messages in a text window.

 

Open Explorer Folder

This sample demonstrates how to open up an Explorer folder. It opens up the Windows Explorer to the Recycle Bin. It also demonstrates displaying messages in a text window.

 

Paste Text

This sample demonstrates how to paste text into an application. It pastes our company address into the notepad program. It also demonstrates the use of launching a program, displaying messages in a text window and various clipboard commands.

 

Popup Menu Using Nicknames

This sample macro demonstrates how to setup and use a Popup Menu macro. A popup menu is very similar to a floating menu except it only appears on the screen when you need to use it. It doesn't hang around. A popup menu macro is simply a toolbar or window that pops up on top of all other programs when you press a hot key or click on an icon in the system tray. The toolbar or window contains a list of other macros which you can activate at will by clicking on a macro in the toolbar or window. If you edit this macro, you will be given a list of all the macros available to be put in the popup menu and a list of all the macros that are currently in the popup menu. You can add or take away macros from the menu at will. When editing the macro there is a properties section. This allows you to choose the style of menu, whether it will be a toolbar with icons or a window with text selections.

 

Process a Text File

This sample demonstrates how to process a basic text file. This macro first creates a small file named mesample.txt. The text file simply contains a short list of names where each name is on a line by itself. The macro reads in each name out of the text file and types it out in the notepad program. This macro also demonstrates setting and manipulating variables, launching a program, displaying messages in a text window and typing text.

 

Process Folder File Names

This sample demonstrates how to process all the file names in a folder. The root folder of your C: drive (i.e. C:\) is processed. Each file name is typed out in the notepad program. It relies on the Repeat With Folder command to do so. This macro also demonstrates the use of variables, launching a program, displaying messages in a text window and typing text.

 

Repeat Until

This sample demonstrates repeating a process until a condition is met. In this example, the user is prompted to enter the name of the program. It repeats this process over and over until the correct program name is entered. This macro also demonstrates the use of setting a variable from a prompt, an if / then statement and displaying messages in a text window.

 

Repeat With Prompt

This sample demonstrates repeating a process using a value entered by the user to determine the number of times to repeat. In this example, the user is prompted to enter a repeat count and a number will be typed into the notepad program the number of times indicated by the repeat. The number shown each time will be a different random number between 1 and 100. This macro also demonstrates the use of a variable, using a random number, typing text, using a repeat counter, launching a program and displaying messages in a text window.

 

Run Control Panel

This sample demonstrates run a control panel applet. It runs the Display Properties control panel applet and sets it to the "Screen Saver" tab. It also demonstrates displaying messages in a text window.

 

Type Dates and Time

This sample demonstrates using dates and times. It types today's date, yesterday's date, the date in a week and the current time into the notepad program. This macro also demonstrates the use of typing text, launching a program and displaying messages in a text window.

 

Variables and Mouse

This sample demonstrates using variables and the mouse. It first saves the coordinates of the mouse into variables. It then moves the mouse in a small circle on the screen. It then returns the mouse to the same location it was at before moving it. This macro also demonstrates the use of delays, macro playback speed, using variables, moving the mouse and displaying messages in a text window.

 

Window Resize and Position

This sample demonstrates how to resize and reposition windows. It uses the notepad program for its example. It first sets the exact size of the window, then increases it by a percentage and then changes it by a pixel amount. It then moves it to the top right corner of the screen, then to the bottom middle of the screen and then to specific location. The notepad program is then restored to its original size and location. It also demonstrates the use of launching a program, using variables and displaying messages in a text window.

 

 

With the Macro Explorer open, press the hot keys associated with the sample macros to watch the macros play back. Afterwards, double click on one of the sample macros listed in the Macro Explorer to load the macro into the Scripting Editor or Direct Editor. Here you can examine the commands used to make the macro work.