Script Editor Overview

Lets go back and edit the script we built. If the Script Manager is not open the open it up (see The Scripts Manager).



Then select the script we built (see Creating a Script) and click on the 'Edit' button. The Script Editor will start back up, and load your script.



If you look at your script you will notice there are small gray squares in the margins next to blocks of code created by wizards. Clicking on those gray boxes will reactivate the wizard that created the code and allow you to make changes to it. It should be noted that anything inside of the comments...
// #block
and
// #end_block
will be replaced when the wizard is finished. Unless the changes are inside of a block that looks like...
// #user 
and
// #end_user
So if you make changes by hand to code inside a block and they are not inside of a #user section, we suggest you erase the #block comments which will remove the gray square from the margin. That way you don't accidentally wipe out your changes later.

Now lets change the script so it will run notepad as soon as the script is run. To do that we need to change the Trigger that activates the script. Start by finding the gray square at the top left of the script and click on it. The 'Fill in the Variables...' screen will be displayed. Now click on the 'Run the Application' property and then click on the ... button. Now drop down the list and instead of choosing 'When a Specific Key Combination is Pressed' choose 'When the Script Starts Up' and press 'OK'. This time you are not presented with a second properties screen, because the 'When the Script Starts Up' trigger does not have any properties. Click on 'OK' and notice that your script has changed. Save and run the script and now notepad starts up right away. It no longer waits for you to press keys. Also, notice that the script now ends on its own. It no longer has to wait around for you to press the keys again. Now close the Script Editor.

Go back to the Script Manager and find your script.



Click on it and then click on the 'Create Shortcut' button. That will place an icon on your desktop that will run the automation script. If you double click on that icon, the script will run and notepad will open up. For this script the desktop short cut was not very useful (after all you could just make a short cut Notepad instead.) But it can be much more useful to have short cuts to scripts that automate more complex tasks for you.

We will create one more type of script and that will end the easy section of the tutorial. Click on the 'Automate New Task' button to create a new blank script in the Script Editor and this time we will learn how to record our interactions with another application.

Next Recording Programs