Tutorial - Macro Scope


Macro Scope

The macro scope indicates under what conditions a macro should play back. Four categories are available. They are Global, Global Except, Window Specific and Program Specific. A global macro will play back in any Windows program. The Global Except option will play back a macro in any Windows program except the application you specify. A Window Specific macro will only play back in a Window that has a matching Window Title as specified by the macro. A Program Specific macro will only play back in a given program. Let's look at some real examples of how this all works. To illustrate the process, let's run two different programs that we can potentially have the macros play back in. Run Windows Notepad and Windows WordPad. To run Notepad, click on "Start | Run" from the bottom left of the computer screen, enter "notepad" and click the OK button. To run WordPad, click on "Start | Run" from the bottom left of the computer screen, enter "wordpad" and click the OK button.

 

 

Global Macro

We've actually already created a couple of Global macros. If you have not created these macros, please refer to the Hot Key section for instructions on creating the CTRL+SHIFT+T macro. A global macro plays back in all Windows programs. To illustrate, bring Notepad to the foreground (click on it in the taskbar). Now press CTRL+SHIFT+T. Your address should type out into the program. Now bring WordPad to the foreground (click on it in the taskbar). Now press CTRL+SHIFT+T. Your address should type out into WordPad.

 

Program Specific Macro

We will now change the CTRL+SHIFT+T macro to become a Program Specific macro. First minimize Notepad and WordPad. With Macro Express the active window, highlight the CTRL+SHIFT+T macro (nickname of "My Address") from the Macro Explorer and click on the Scripting Editor button. Then click on the Scope tab. Next, select the Program Specific option and click on the Select button. A new window appears named Select Programs.

 

 

Here you can enter the name of the program that your macro will work with. On the left is a list of all current programs that are running on your computer. Scroll through the list of programs running and find notepad.exe. Highlight it in the list and click on either Add button. This will place notepad.exe in the Program Name edit box. (You may also note that there is a button called "Select from list of installed programs". You could click on this button for a list of all programs installed on your computer and select from this list.) Make sure the Run If On Top option is selected and then click on the OK button. Click on File | Save to save your macro changes. Click on the Macro Explorer button and note that the scope for the CTRL+SHIFT+T macro (nickname of "my address") has changed from Window Specific: notepad to Program Specific:notepad.exe.

 

To see what effect the changes have on the macro, bring Notepad to the foreground (click on it in the taskbar) and press CTRL+SHIFT+T. Your address should type out into the program. Now bring WordPad to the foreground (click on it in the taskbar). Press CTRL+SHIFT+T. Nothing happens. You have defined CTRL+SHIFT+T to only work in the Notepad program.

 

Global Except

We will now change the CTRL+SHIFT+T macro to become a Global Except macro. First minimize Notepad and WordPad. With Macro Express the active window, highlight the CTRL+SHIFT+T (nickname of "my address") macro from the Macro Explorer and click on the Scripting Editor button. This will display the Macro Scripting Editor. Click on the Scope tab. Next, select the Global Except option and click on the Select button. A new window appears named Select Programs.

 

 

This time you will select the program that the macro will not work with  It should work in all other programs. On the left is a list of all current programs that are running on your computer. Notepad.exe should already be selected. If not, scroll through this list of programs running, find notepad.exe and click on it. This will place notepad.exe in the Program Name edit box. (You may also note that there is a button called "Select from list of installed programs". You could click on this button for a list of all programs installed on your computer and select from this list.) Click OK to save the program choice. Then click on File | Save to save your macro changes. Click on the Macro Explorer button and note that the "scope" for the CTRL+SHIFT+T macro has changed from Program Specific to Global Except.

 

To see what effect the changes have on the macro, bring Notepad to the foreground (click on it in the taskbar) and press CTRL+SHIFT+T. Nothing happens. The macro is defined to not work with Notepad. Now bring Wordpad to the foreground (click on it in the taskbar). Press CTRL+SHIFT+T. Your address should type out into the program. You have defined CTRL+SHIFT+T to work in all programs except the Notepad program. Activate another program that accepts text input such as your email program and press CTRL+SHIFT+T. Your address should type out into the program.

 

Window Specific Macro

Lastly, we will change our CTRL+SHIFT+T macro to become a Window Specific macro. First minimize WordPad and Notepad. With Macro Express the active window, highlight the CTRL+SHIFT+T macro from the Macro Explorer and click on the Scripting Editor button. This will display the Macro Scripting Editor pane. Next click on the Scope tab. Then select the Window Specific option and click on the Select button. A new window appears named Select Window.

 

 

Here we enter the name of the Window Title. (A Window Title is the text that appears in the top blue caption bar of most windows). First you will note that notepad.exe is most likely listed in the Selected Window field. Highlight this .exe and then click on the Remove button.

 

On the left is a list of all current windows that are running on your computer. You could browse through this list, but for this example just enter notepad in the Selected Window edit box and click on the Add button to the right of this edit box. Select the Run If On Top Option and then click on the OK button. Click on the Save Macro speed button or File | Save to save your macro changes. Click on the Macro Explorer button and note that the scope for the My Address macro has changed from Global to Window Specific:notepad.

 

To see what effect these changes have on the macro, bring Notepad to the front of the screen (click on it in the taskbar. Now press CTRL+SHIFT+T. Your address should type out into the program. Now bring WordPad to the front of the screen (click on it in the taskbar). Now press CTRL+SHIFT+T. Nothing happens. You have defined CTRL+SHIFT+T to only work in a notepad window.