Typing Into Notepad Example

In this example, we will create a very simple  task that opens Notepad and types the text "Hello, world" into it whenever we press Ctrl-Alt-N.

WHAT'S COVERED:
* Step by step creation of a managed task using the Add Task Wizard
* Introduction to triggers, with emphasis on the Key Watcher
* Introduction to building a task steps with the Task Builder
* Using the Run Action to start an application
* Using the Send Keystrokes action to send keystrokes to an application

NOTE: This example assumes that the Add Task Wizard is used to create tasks.  This is the default behaviour.  To ensure the Add Task Wizard is used, go to the System | Options menu in the AutoMate Task Administrator, and from the General tab, make sure "Use Add Task Wizard when adding tasks" is selected.

Step 1:
Click the New button from the toolbar of the AutoMate Task Administrator.

Step 2:
The Add Task Wizard should appear.  Click the Next button to move to the next page.

Step 3:
Enter a name for your task.  For example, "Typing Into Notepad Example". This is the name by which the task will be referred to in the Task Administrator.   Click the Next button.

Step 4:
Here we can apply one or more triggers to the task.  A trigger is an event or condition that occurs on your system that will cause the task to start.  For our example, we want a particular key press on the keyboard to trigger our task, namely Ctrl-Alt-N.  Therefore, we need to add a "Key Watcher".  Click the Add button to display a list of available triggers.

Step 5:
From
the list of available triggers, click Key watcher, then click OK.

Step 6:
You are now looking at the Key Watcher properties.  From here you can configure what key combination to trigger upon.  The key combination can be either a single keystroke (such as Ctrl-A), or an entire word.  You can even constrain the triggering to occur only when the keystroke is entered while a particular application is highlighted.  But for our example, we simple want to trigger when Ctrl-Alt-N is pressed.  To do this, make sure the "Trigger on following hot key" is selected, and click inside the corresponding field.  Press the Ctrl, Alt and N keys at the same time, then release them.  Notice that Ctrl-Alt-N appears in the field.  AutoMate will automatically transpose the proper sequence into the field based on what you type.

Step 7:
Now, the Triggers part of the Add Task Wizard should contain your one Key Watcher trigger. Click the Next button to move to the next page of the wizard.

Step 8:
Now, we need to build the steps of the task.  This is where you specify exactly what the task is to do when it is started.  This is done using the AutoMate Task Builder, which is an editor made specifically for creating and debugging AutoMate Tasks.  Click the "Create Steps" button to start the AutoMate Task Builder.

Step 9:
The Task Builder provides many functions to help you in creating and debugging your task.  For this example, we will use only a very small part of its capabilities.  The left side of the Task Builder contains the "Available Actions".  Within this window are all the actions that AutoMate can do.  The right hand side contains all the steps that the task will execute when the task runs.  Steps are executed one after the other in the order they appear on the right side.  Our task is going to consist of only two steps: Run and Send Keystrokes.  Our first step is to tell AutoMate to start Notepad.  Find the "Run" action in Available Actions by expanding the System group (either by clicking the + to the left of the word "System" or by double-clicking on "System").  Double-click "Run", or drag it to the right hand side by holding the left-mouse button over the action name, sliding the mouse over the steps section of the Task Builder, and releasing the mouse button.

Step 10:
Most actions have properties you can set to further configure exactly what the step is to do.  In our case, we need to tell the Run Action exactly what application we want to run.  We can do this two ways: by manually typing out the full path to the executable file, or by using AutoMate's Start Menu to find the application we wish to start.  The latter is the easiest way to go.  Click the Start button.  Notice it is an exact replication of your Windows Start Menu that appears at the bottom of your screen.  Navigate to find Notepad, which is usually located under Programs, then Accessories (but may be different on your system).

NOTE: If you have trouble locating Notepad in this fashion, simple type the text "notepad" into the "Run" field.  Since notepad.exe is a system application, AutoMate will be able to find it on name alone.

Step 11:
The full path to Notepad should appear in the Run field, and your action should look something like this:

NOTE: The exact path to Notepad varies somewhat on each version of Windows.  The important part is that the field ends with either "notepad" or "notepad.exe"

Step 12:
Our complete Run step should now be in the Task Builder.  When the task starts, AutoMate will run Notepad. Now we need to type the text "Hello World!" into it.  From the Available Actions, find the Send Keystrokes action in the Interactivity group.  Double-click or drag to add it to your task.

Step 13:
Here we need to specify what text to type.  Whatever you enter into the "Keystrokes" section will be replicated when the task runs as if a user were typing the exact same text.  Enter the text "Hello, world!" (without the quotes) into the "Keystrokes" area.

Step 14:
Thats it!  Those two simple steps will cause Notepad to start, and text to be typed into it. This part of the task is now complete.  Click the "Update And Save" button from the toolbar to save your changes and close the Task Builder.  You will be returned to the Add Task Wizard.

Step 15:
Now that we are finished adding the task steps, click the Next button.  The next page is used on Windows 2000/NT/XP to specify whether or not the task should run when a workstation is logged off or locked.  For this example, leave the defaults: the task will not run when the workstation is logged off, but will run invisibly when the workstation is locked.  Click the Next button.

Step 16:
The final page of the Add Task Wizard provides a summary of the task you built.  Click the Finish button.  The completed Managed Task now appears in your Task Administrator. Whenever you press Ctrl-Alt-N (at the same time), Notepad will start and "Hello, World!" will be typed into it.  Try it now!

See Also:

Introduction to triggers

Introduction to actions

Introduction to the Task Builder

Introduction to the Task Administrator

Key Watcher

Run Action

Send Keystrokes Action