There are a lot of macro/automation tools out there that record key presses and mouse movements in order to quickly or automatically perform routine tasks. I've discovered an easy to use one that performs better than most -- Script It, published by Microsoft years ago (1998) as freeware.
You use it by creating a step by step text script for it to follow, which is easy enough for anyone to do. It can run programs or command lines and send keystrokes to various windows. Some benefits are that it enters keystrokes based on a window's title rather than just running a timed sequence as other programs do -- which can foul up if something on the screen is not as expected or the timing is off. It's also executes commands blazingly fast.
It's an EXE that runs a text file containing a script, you launch it with a shortcut or batch file with a command line like the following.
C:\Utilities\ScriptIt\SCRIPTIT.EXE actfast.ini
You can name your script file anything you like, with any extension, as long as you instruct scriptit.exe to run it as demonstrated.
Simple script examples:
The following script would launch Notepad and then type a phrase in the Notepad window:
[SCRIPT]
run=C:\WINDOWS\Notepad.exe
Untitled - Notepad=Hello there.
The run command points to the program or command to run. The second line names the window
by title, which by default is "Untitled - Notepad" (case sensitive), and tells what keystrokes to send to that window, which in this case is "Hello there." The end result is a notepad window on your screen containing the words "hello there".
Taking the concept a bit further:
[SCRIPT]
run=C:\WINDOWS\Notepad.exe
Untitled - Notepad=Hello there.##
Untitled - Notepad={ALT}f
Untitled - Notepad=a
Save As=c:\desktop\hello.txt
Save As={ENTER}
hello.txt - Notepad=!{F4}
Line 1) Notepad is launched.
Line 2) The phrase is typed then "##" inserts a five second delay before the next command is executed.
Line 3) The ALT key is pressed followed by F, to bring up the file menu.
Line 4) The A key is pressed (in the File menu), prompting the "Save As" dialog box.
Line 5) A directory path and filename is typed into the "Save As" window.
Line 6) The enter key is pressed in the "Save As" window, saving the file.
Line 7) The Notepad window title has changed, an Alt-F4 key combo closes the window (!=alt).
The end result is a saved text file, created by a simple step by step script. Easy, eh?
The reason I sought out such a program was to automatically switch video modes without requiring a program always running in the background. Some "recording" type of macros I tried failed at times or were too slow, while ScriptIt gave me what I needed faster than I could follow it on screen.
A little known way to launch the "Display Properties" dialog with the "Settings" tab already selected (to change screen resolution, color depth, etc.) is to use the following command line in a shortcut (in Win98 at least):
C:\WINDOWS\RUNDLL32.EXE shell32.dll,Control_RunDLL desk.cpl,,3
By running that command with ScriptIt and then supplying the proper sequence of keystrokes that follow you can change the screen resolution or even manipulate the advanced video card properties.
I wrote the following script to change my screen resolution then switch my video card into TV out mode (to play games on a TV screen). A commandline is launched to bring up the the first window then keystrokes are sent to the various windows by name. The TAB key is used to cycle through the menus and the SPACE key is used to activate selected buttons.
[SCRIPT]
run=C:\WINDOWS\RUNDLL32.EXE shell32.dll,Control_RunDLL desk.cpl,,3
Display Properties={TAB 2}
Display Properties={SP}
Rage 128 Properties={TAB 5}
Rage 128 Properties={UP}
Rage 128 Properties={TAB 5}
Rage 128 Properties={SP}
Rage 128 Properties={TAB 3}
Rage 128 Properties={SP}
ATI Property Page={TAB}
ATI Property Page={SP}
Rage 128 Properties={ESC}
Display Properties={TAB 5}
Display Properties={LEFT 5}
Display Properties={RIGHT 3}
Display Properties={TAB 2}
Display Properties={SP}
Display Properties={SP}
Monitor Settings={TAB}
Monitor Settings={SP}
Each key was given it's own line in the script and when you see a number following the key it indicates the key is pressed that many times. That script is not written as efficiently as it could be but it's easy to follow and is probably the best way to first write one. It can be shortened to the following, where the "#" sign separates keystrokes sent to the same window.
[SCRIPT]
run=C:\WINDOWS\RUNDLL32.EXE shell32.dll,Control_RunDLL desk.cpl,,3
Display Properties={TAB 2}#{SP}
Rage 128 Properties={TAB 5}#{UP}#{TAB 5}#{SP}#{TAB 3}#{SP}
ATI Property Page={TAB}#{SP}
Rage 128 Properties={ESC}
Display Properties={TAB 5}#{LEFT 5}#{RIGHT 3}#{TAB 2}#{SP}#{SP}
Monitor Settings={TAB}#{SP}
That script is only useful to me but I think it serves as a good visual example. In actual fact that script is what turns
off my TV mode and resets the screen to my preferred resolution.
Downloads and info:
From Microsoft, you can download ScriptIt
HERE and read about it
HERE.
I recommend you read more about ScriptIt (and find another download link)
HERE.
Funnily enough ScriptIt is actually a compiled
WinBatch script (a commercial third-party tool).
Also, if you like the idea of ScriptIt and you wish to go much further with it you should probably use the similar and up to date freeware program called
Auto It. It does much more but it can also be more difficult to use. Advanced users would do well to use it instead.
Macros discussed previously:
http://mtm2.com/~mtmg/special/macros/
http://mtm2.com/~mtmg/special/macros/examples.html
http://forum.mtm2.com/viewtopic.php?t=2803