Sample Macros
Here are some example macros that will help you get started:
Mass rename files in a folder
This macro renames all files in a given folder to "file1", "file2", "file3" etc. Just keep pressing Ctrl + Alt + Z in Macro Recorder and the macro will iterate to the next file.
SET CLIPBOARD : 1 WAIT FOR USER : 90 : 3 : 0 : 0 LABEL : BEGIN Keyboard : F2 : KeyPress TYPE TEXT : file PASTE Keyboard : Return : KeyPress INCREMENT CLIPBOARD : 1 Keyboard : Down : KeyPress WAIT FOR USER : 90 : 3 : 0 : 0 GOTO : BEGIN
Check for updates command (Windows 7)
This macro launches the “Windows Update” tool and forces it to check for updates by simulating a mouse click on the “Check now” link. The mouse-click uses “relative” coordinates, so it’s immune to window size and location change.
This macro has been tested under Windows 7 only, might not work under Vista or XP.
OPEN FILE : wuapp.exe : : 0 WAIT FOR : Windows Update : appear : 0 : 0 DELAY : 200 Mouse : R115 : R125 : LeftButtonDown : 0 : 0 DELAY : 56 Mouse : R115 : R125 : LeftButtonUp : 0 : 0
Launching IE proxy dialog
This macro launches Internet Explorer's "Proxy server" dialog.
The macro actually has no practical use, but it's a fine example of how a macro can use:
- "launch process" macro-command
- "wait for process" macro-command
- sending mouse-clicks from a macro, based on window-relative coordinates
- sending key combinations (that is - Alt+Letter in this particular macro example)
OPEN FILE : iexplore : : 0 WAIT FOR PROCESS : iexplore : appear : 0 : 0 DELAY : 400 Keyboard : AltLeft : KeyPress DELAY : 200 Keyboard : T : KeyPress DELAY : 300 Keyboard : O : KeyPress DELAY : 1500 Mouse : R246 : R47 : LeftButtonDown : 0 : 0 DELAY : 592 Mouse : R246 : R47 : LeftButtonUp : 0 : 0 DELAY : 500 Keyboard : AltLeft : KeyDown DELAY : 469 Keyboard : L : KeyDown DELAY : 80 Keyboard : L : KeyUp DELAY : 232 Keyboard : AltLeft : KeyUp
Clear IE cache
This script for Jitbit Macro Recorder launches Internet Explorer privacy cleaner. Tested under IE7, IE8. Never tested it with IE9 though.
MESSAGE BOX : This macro will open Internet Explorer, launch the "Internet options" dialog and clean "temporary internet files" OPEN FILE : iexplore : : 0 DELAY : 1000 Keyboard : AltLeft : KeyPress Keyboard : AltLeft : KeyDown Keyboard : T : KeyDown Keyboard : T : KeyUp DELAY : 500 Keyboard : O : KeyDown Keyboard : O : KeyUp Keyboard : AltLeft : KeyUp DELAY : 500 Keyboard : AltLeft : KeyDown Keyboard : D : KeyPress Keyboard : AltLeft : KeyUp DELAY : 500 Keyboard : AltLeft : KeyDown Keyboard : D : KeyPress Keyboard : AltLeft : KeyUp
Disk defragmentation macro (Windows 7)
Windows 7 introduced a new disk defragmenter tool that is automated in by this macro.
The macro simply starts the defragmenter and sends an “Alt+D” keyboard combination to its window.
OPEN FILE : C:\Windows\System32\dfrgui.exe : : 0 DELAY : 1000 Keyboard : AltLeft : KeyDown Keyboard : D : KeyPress Keyboard : AltLeft : KeyUp
Disk defragmentation macro (Win XP)
1) The first line of the macro launches the Windows XP Disk Defragmenter:
OPEN FILE : dfrg.msc
2) The next line simply waits for the defragmenter window to appear:
WAIT FOR : Disk Defragmenter : appear : 2000
3) Finally this block launches the appropriate item in the defragmenter window menu (which in our case is "Actions - Defragment"):
Keyboard : AltLeft : KeyDown Keyboard : A : KeyDown Keyboard : A : KeyUp Keyboard : D : KeyDown Keyboard : D : KeyUp Keyboard : AltLeft : KeyUp
Of course you don't have to actually type these commands when you create a script in Macro Recorder, you can use the toolbar instead. First you click "Insert 'Open file' command", then you click "Insert 'Wait for window' command" etc... Jitbit's macro-language remains "hidden", it is used only if you decide to edit a saved macro in some external text editor like Notepad (which is the preferred way for some programmers and tech-geeks).
Full macro:
OPEN FILE : dfrg.msc : : 0 WAIT FOR : Disk Defragmenter : appear : 1000 : 0 Keyboard : AltLeft : KeyDown Keyboard : A : KeyDown Keyboard : A : KeyUp Keyboard : D : KeyDown Keyboard : D : KeyUp Keyboard : AltLeft : KeyUp