Using Window Controls
This is an example of using Window Controls. The macro sends text to notepad while the program window is minimized to the task bar.
A copy of notepad needs to be open. To do this type notepad in the Search the web and Windows search box in the Task Bar and press Enter.
Select a Macro Activation
For this example we will create a hot key activated macro.
1.From the Macro Express - Explorer click on the New Macro icon to open the Create New Macro window.
2.HotKey should be the default Initial Activation.
3.Click on the HotKey edit box to place the cursor there.
4.Press the Ctrl + Alt + 4 keys and release them. Ctrl + Alt + 4 should appear in the edit box.
5.Enter "Text to Notepad" (without the quotes) in the Macro Nickname edit field.
6.Click OK to save the changes and open the Script Editor.
Set the Macro Scope
1.With the Script Editor open, click on the Scope tab.
2.Set the Current Scope to Global.
Writing the Macro
Setting the Control Variable
1.Click on the Script tab.
2.Expand the Window Controls category of commands.
3.Double click on the Get Control command to open the Get Control window.
4.Select the Hide Macro Express option.
5.Click on the Variables button to the right of the Store the Control In field.
6.Expand the Control Variables list and click on the C variable.
7.In the Variable Name field enter the number 1 between the brackets to show C[1] and click OK to save.
8.Click on the Launch Utility button to open the Capture Window Control window.
9.If notepad is not visible on the screen open the program window.
10.Click on the blue X crosshairs on the Capture Window Control window and drag it over top of the notepad edit field. It will be outlined in black as shown.
11.Release the mouse button to insert the control information into the Control Details panel.
12.Click the save button to save the information and return to the Get Control Window which should now look like the following image.
13.Click OK to save and return to the Script Editor.
Sending Text to the Control
1.Expand the Keyboard Category of commands and double click on the Text Type command to open the Text Type window.
2.Enter some text in the edit field, such as This is a test.
3.Click on the Simulate Keystrokes drop down list and select Send Text Directly to Control.
4.Click on the Variables button to the right of the Control field.
5.Expand the Control Variables list and click on the C variable.
6.In the Variable Name field enter the number 1 between the brackets to show C[1] and click OK to save the variable selection.
7.Click OK in the Text Type window to save the change and return to the Script Editor.
Macro Script
When finished the macro script should look like the following example. If something is not in the correct order, highlight the command and click on the Up or Down arrows to the right of the Script and move the command to its proper location.
Get Control: (NOTEPAD.EXE) Using z-order -> %C[1]% Text Type (Send Text Directly to Control %C[1]%): This is a test. |
Run the Macro
Make sure that notepad is running, but minimized to the task bar. Press the Ctrl + Alt + 4 hotkey. Open Notepad from the task bar. You will notice that the text has been inserted into notepad. The program window does not need to have focus in order for the text to be inserted.