1     Mouse and Key Recorder - Manual 

 

1.1     Mouse and Key Recorder

 

Manual for 'Mouse and Key Recorder' Version 7.3

 

Further information about the Mouse and Key Recorder can be found in the Internet:

http://www.kratronic.com/tools/recorder/

(Copy this link to the Internet browser to open the manual there)

 

Download this Manual  (MS Word Format)

 

How to save the Manual: Click the right mouse button on the above link and choose save.

If this does not work, then click on the above link. Your HTML Help window shows the manual after a while.. Now use 'CTRL a' to select the text, 'CTRL c' to copy the text, open an empty Word document and use 'CTRL v' to paste the Manual to the Word document. Now save or print it.

 

 Content

 

1       Mouse and Key Recorder - Manual.. 1

1.1        Mouse and Key Recorder.. 1

1.2        Introduction.. 4

1.3        'Mouse and Key Recorder' Requirements. 5

1.4        Licenses. 5

1.5        Functions. 6

1.6        Working with 'Mouse and Key Recorder' 6

1.6.1    Important Hints. 7

1.7        Recording macros. 7

1.8        Your first 'Mouse and Key Recorder'  Macro.. 8

1.9        Function Description.. 8

1.9.1    Macro Window and Key Entering. 9

1.9.2    Loading and Storing Macros. 11

1.9.3    Start or Switch to an Application. 12

1.9.4    Loops. 12

1.9.5    Adding Commands. 13

1.10     All Commands. 14

1.10.1      Command Descriptions. 15

1.10.1.1  {{' Text, {{'' Text 15

1.10.1.2  {{SendTextSpecial}, {{SendTextNormal}. 15

1.10.1.3  {{WindowsAeroOff}, {{WindowsAeroOn}, 15

1.10.1.4  {{GetAeroState}. 15

1.10.1.5  {{Start, {{StartAndWait 15

1.10.1.6  {{SetCurrentDir 16

1.10.1.7  {{DOS. 16

1.10.1.8  {{Switch. 16

1.10.1.9  {{SwitchOrStart 17

1.10.1.10    {{Loop}. 17

1.10.1.11    {{LockUI 17

1.10.1.12    {{SetLoop. 17

1.10.1.13    {{Offset 18

1.10.1.14    {{1}. 18

1.10.1.15    {{8}. 18

1.10.1.16    {{<8}. 18

1.10.1.17    {{>8}. 18

1.10.1.18    {{n}. 18

1.10.1.19    {{Beep}. 18

1.10.1.20    {{MessageBox. 18

1.10.1.21    {{FlashBox. 18

1.10.1.22    {{ShowInfo. 19

1.10.1.23    {{WaitForKey. 19

1.10.1.24    {{Stop}. 19

1.10.1.25    {{Exit}. 19

1.10.1.26    {{Var}, {{GlobVar}. 20

1.10.1.27    {{SetVar, {{SetGlobVar 20

1.10.1.28    Increment, Decrement, Multiply and Divide. 20

1.10.1.29    {{String}, {{GlobString}. 20

1.10.1.30    {{SetString}, {{SetGlobString}. 21

1.10.1.31    {{Ask},  {{GlobAsk}, {{WriteAsk},  {{WriteGlobAsk}. 21

1.10.1.32    {{SetClipBoard, {{ClipBoard}. 23

1.10.1.33    {{DownLoop}, {{UpLoop}, {{RightLoop}, {{LeftLoop}. 23

1.10.1.34    {{DownVar, {{UpVar, {{RightVar, {{LeftVar 23

1.10.1.35    {{DateTime}. 23

1.10.1.36    {{Date}. 23

1.10.1.37    {{Time}. 23

1.10.1.38    {{SerialTime}. 23

1.10.1.39    {{CreateSerialTime. 24

1.10.1.40    {{AddSerialTime. 24

1.10.1.41    {{PCIdle}. 24

1.10.1.42    {{Delay, {{ExtDelay. 24

1.10.1.43    {{WaitForTime. 24

1.10.1.44    {{RandomNumber 24

1.10.1.45    {{RandomString. 25

1.10.1.46    {{ImportFile, {{ImportSeparator, {{DoImport}, {{ImportNextLine. 25

1.10.1.47    {{If. 25

1.10.1.48    {{True}, {{False}. 26

1.10.1.49    {{FindFile. 26

1.10.1.50    {{CompareFiles. 26

1.10.1.51    {{ScanDirectories. 26

1.10.1.52    {{CreateDir 27

1.10.1.53    {{CopyDir 27

1.10.1.54    {{DeleteDir 27

1.10.1.55    {{CopyFile. 27

1.10.1.56    {{RenameFile. 28

1.10.1.57    {{DeleteFile. 28

1.10.1.58    {{FileAttrib. 28

1.10.1.59    {{Goto. 28

1.10.1.60    {{Gosub, {{Return}. 28

1.10.1.61    {{Label 29

1.10.1.62    {{LoadMacro. 29

1.10.1.63    {{Master}. 29

1.10.1.64    {{WriteToFile, {{WriteLineToFile. 29

1.10.1.65    {{Minimize}, {{Normalize}. 30

1.10.1.66    {{SetIndex1}, {{Index1}. 30

1.10.1.67    {{NumLockOn}, {{NumLockOff}. 30

1.10.1.68    {{SetGenDelay. 30

1.10.1.69    {{WaitForIEReady. 30

1.10.1.70    {{SetIEFocus. 31

1.10.1.71    {{WaitForScreenChange. 31

1.10.1.72    {{GetPixel 31

1.10.1.73    {{RGB.. 32

1.10.1.74    {{FindPattern. 32

1.10.1.75    {{CheckWindow.. 36

1.10.1.76    {{GetWindowPos. 36

1.10.1.77    {{GetCursorPos. 36

1.10.1.78    {{Decode. 36

1.10.1.79    {{Sort 36

1.10.1.80    More commands. 37

1.10.2      Special Commands. 37

1.10.2.1  {{CTRL, {{Shift, {{Alt 37

1.10.2.2  {{CTRL+/-, {{Shift+/-, {{Alt+/- 37

1.10.2.3  {{Space. 37

1.10.2.4  {{CR}, {{LF}, {{Tab}. 37

1.10.2.5  {{MouseDownTime. 38

1.10.2.6  {{KeyDownTime. 38

1.10.2.7  {{MacroPath}. 38

1.10.2.8  {{AppDataPath}. 38

1.10.2.9  {{AppPath}. 38

1.10.2.10    {{FileSize. 38

1.10.2.11    {{WindowsKey. 38

1.10.2.12    {{NoFocus}. 38

1.10.2.13    {{GetWindowName}. 39

1.10.2.14    {{CapsLockOn}, {{CapsLockOff}. 39

1.10.2.15    {{DebugOn}, {{DebugOff}. 39

1.10.2.16    {{ResetLogFile}. 39

1.10.2.17    {{BracesReplace. 39

1.10.2.18    {{HDFreeSpace. 40

1.10.2.19    {{HDUsedSpace. 40

1.10.2.20    {{GetOSVersion}. 40

1.10.2.21    {{SendEMail}. 40

1.10.2.22    Mathematical and string commands. 41

1.10.2.23    {{Power 41

1.10.2.24    {{Mod. 41

1.10.2.25    {{Div. 41

1.10.2.26    {{IsNumeric. 41

1.10.2.27    {{Len. 42

1.10.2.28    {{InStr 42

1.10.2.29    {{Mid. 42

1.10.2.30    {{Left 42

1.10.2.31    {{Right 42

1.10.2.32    {{Trim.. 42

1.10.2.33    {{Ucase. 42

1.10.2.34    {{Lcase. 42

1.10.2.35    {{Chr 42

1.10.2.36    {{Asc. 42

1.10.2.37    {{Replace. 43

1.10.2.38    {{Calc. 43

1.10.3      File Import 44

1.11     Editing Macros. 46

1.11.1      Command Delays. 46

1.11.2      Delayed Macro Start 47

1.11.3      Scheduled Macro Start (Scheduled Tasks) 47

1.11.4      Mouse Entries. 49

1.11.5      Status Information. 51

1.11.6      Command Line Function. 52

1.11.7      Calling a Macro by a Hotkey. 52

1.11.8      Creating a 'Mouse and Key Recorder' icon. 53

1.11.9      Debug-Log-File. 53

1.11.10    Debug Window.. 53

1.11.11    Options. 53

1.12     Help Menu.. 58

1.12.1      Macro List 59

1.13     Debugging.. 59

1.14     Special Functionality: Automated Software Test. 60

1.14.1      Function description. 61

1.14.1.1  {{CheckFocus. 61

1.14.1.2  {{WaitForFocus, {{WaitForEndFocus. 63

1.14.1.3  {{MessageBox2. 63

1.15     Keyboard Language. 63

1.16     Macro Examples. 64

1.16.1      Examples for individual commands (or command groups) 64

1.16.1.1  Comments. 64

1.16.1.2  {{Start, {{StartAndWait 64

1.16.1.3  {{DOS. 64

1.16.1.4  {{Switch, {{SwitchOrStart 65

1.16.1.5  {{Loop. 66

1.16.1.6  {{WaitForKey. 67

1.16.1.7  {{SetVar, {{Var, {{SetString, {{String. 67

1.16.1.8  {{Ask, {{WriteAsk. 68

1.16.1.9  {{SerialTime. 69

1.16.1.10    {{WaitForTime. 69

1.16.1.11    {{CreateSerialTime, {{AddSerialTime. 69

1.16.1.12    {{ImportFile, {{ImportSeparator, {{DoImport}, {{ImportNextLine}. 70

1.16.1.13    {{ScanDirectories. 70

1.16.1.14    {{Gosub. 72

1.16.1.15    {{Master 72

1.16.1.16    {{WaitForIEReady. 73

1.16.1.17    {{GetPixel 73

1.16.1.18    {{CheckWindow.. 74

1.16.1.19    {{Sort 74

1.16.1.20    Mathematical commands. 75

1.16.1.21    {{Text-Commands. 75

1.16.2      OR functionality || 76

1.16.3      Examples for solving general tasks. 77

1.16.3.1  Example for repeating the whole macro or parts of it 77

1.16.3.2  {{If command with several commands for 'then' and 'else' 77

1.16.3.3  Waiting for the download of an Internet page by Firefox. 78

1.16.3.4  Waiting for the download of an Internet page by Internet Explorer 78

1.16.3.5  RandomString using self defined characters. 79

1.16.3.6  Using several Hotkey Sets. 79

1.16.3.7  Restarting PC regularly. 79

1.16.3.8  Further examples. 80

1.17     Hints / Limitations. 81

1.18     Installation.. 83

1.18.1      PC independent installation. 83

1.19     Upgrade Installation.. 83

1.20     Upgrade Information.. 83

1.21     Disclaimer.. 84

 

 

 

1.2     Introduction

 

A long, long time ago, when Windows 3.1 still was in favor, we all had access to a tool called Recorder. This recorder was able to record and replay keystrokes and mouse clicks.

That way simple macro files could be recorded. By double clicking on an icon, an application could be started and certain actions within this application could be carried out.

When Windows NT and Windows 95 arrived, the recorder disappeared without any trace.. The only way to use a batch file was DOS ! Later on VBS (Visual Basic Scripting) appeared, but VBS is much too complicated for everyday macros.

 

The 'Mouse and Key Recorder' for Windows XP/Vista/Win7, written by John Krauer, fills this painful gap. The next picture shows this tool.

 

 

 

 

1.3     'Mouse and Key Recorder' Requirements

 

Operating System:

The 'Mouse and Key Recorder' runs on the following operating systems:

 

The Mouse and Key Recorder was not tested on Windows Server versions, but there is no reason why it should not work there too.

 

Resolution:

The 'Mouse and Key Recorder' needs a screen resolution of at least:

 

 

1.4     Licenses

 

The 'Mouse and Key Recorder' is a shareware program. That means you can test this program for 3 months. After that time you must buy a licensed version. With the test version you cannot store any macros to the disk anymore after three months. The licensed version can be bought over the Internet.  Address:

http://www.kratronic.com/tools/recorder/

 

A single license for the 'Mouse and Key Recorder' costs $23.00 (US). (Site license: $100.00 (US), World wide license: $300.00 (US)

 

License Terms:

·         A single license is meant for one PC only.

 

A site license and the worldwide license can be used anywhere in the company. (But not outside the company)

 

The state of your Mouse and Key Recorder (Test-Version or Licensed Version) is shown in the About Box. (Menu: ‘?’)

 

 

1.5     Functions

 

The 'Mouse and Key Recorder' is able to record mouse clicks and keystrokes and to replay them. But this is only the core function. There is much more:

 

 

1.6     Working with 'Mouse and Key Recorder'

 

The 'Mouse and Key Recorder' records, as the name expresses, mouse clicks and keystrokes.

The "old" Recorder (Windows 3.1) had no edit functionality. If a wrong key was pressed, the whole recording had to be repeated. The 'Mouse and Key Recorder' records all keystrokes and all mouse clicks within any application (exception: DOS Boxes). The recorded macro can then be stored, edited and replayed. More than 140 additional commands lets you master nearly every task you want to automate.

 

 

1.6.1     Important Hints

 

The 'Mouse and Key Recorder' is a powerful tool. As with every powerful application, care has to be taken using it. The 'Mouse and Key Recorder' replays all commands you have stored to the macro file. The Recorder does not check automatically if the situation is the same you had previously, when you recorded the macro. That means if the Recorder gets ‘out of synchronization’ some damage could be done. In this situation, wrong menus are clicked, OK is pressed for ‘wrong’ commands, and so on..

How can you avoid such uncomfortable and even dangerous situations? Here are some hints on what you should do:

 

 

The 'Mouse and Key Recorder' has been tested to the best of our abilities for bugs. The author of 'Mouse and Key Recorder' is not responsible for any damage that may incur to the user's system or data as a result of using 'Mouse and Key Recorder'.

 

 

1.7     Recording macros

 

After starting the 'Mouse and Key Recorder' you get a window shown at the beginning of this manual. Normally you want to carry out actions on applications like Microsoft Word, Excel, E-Mail etc. That means first you need to add a command to start (or switch to) the needed application. To do so press the tab 'Macro Code' then button ‘Insert Command' ( {{.. ). Type in Switch 1)  or Start. The 'Mouse and Key Recorder' presents you a hint, a description of the syntax and a short help about that command. Complete the command and press OK. Now click the button 'Append Recording' (red dot) to activate key and mouse recording. Important: Switch now to your application by using ALT TAB. ALT TAB is not recorded by the 'Mouse and Key Recorder'. Operate your application. You can use keystrokes, mouse clicks (all three buttons), mouse double clicks, dragging mouse. Some actions you do need some time. The 'Mouse and Key Recorder' records your keystrokes without any timing information. (Means your macro will run much faster than you type). As a result you need to include delays. This can be done by a hot key: CTRL SHIFT ALT F12 and then one of the keys 0..'m'. Assignments: 1: 300 ms, 2: 500 ms, 3: 750ms, 4: 1min, 5: 2min, 6: 5min, 7: 10min, 8: 15min, 9: 50min, 0: 1hour; q: 1sec, w: 2sec…..o: 9sec; p: 10sec; a: 11sec, s: 12sec….l: 19sec; y/z: 21sec, x: 22sec….m: 27sec.

Finish your work by switching back to the 'Mouse and Key Recorder' using ALT TAB. Click button 'Append Recording' to stop the recording mode.

If you need to edit your macro you click the register tab 'Macro Code'.

You can find a comprehensive description of all functions in Chapter 8: 'Function Description'.

Hint: In the Normal-Text-Mode the Mouse and Key Recorder treats keystrokes and mouse clicks differently. Keystrokes wait for the application. That means a second keystroke is sent but not until the first keystroke is processed by the application. Mouse clicks are sent according to the speed set in the Recorder. That means, working with mouse clicks needs a more careful delay management (enough delay between each mouse click). Conclusion: Use Normal-Text-Mode keystrokes (and not mouse clicks) when ever possible.

 

1)  To add a Switch command you can also use CTRL-ALT-SHIFT-F12  F12. See also command description {{Switch.

 

 

1.8     Your first 'Mouse and Key Recorder'  Macro

 

This chapter gives you a first impression how easy it is, to create a macro by using the 'Mouse and Key Recorder'.

 

Try the following steps:

 

 

Now change 'Line Delay' (in Tab 'General') to 1000 and click 'Play' (blue triangle) and see what the Mouse and Key Recorder does for you…

After that you can reduce the value of 'Line Delay'. But, if you choose a too short time, errors might occur. (Mouse clicks are delivered faster than the word processor can process them)

 

 

1.9     Function Description

 

1.9.1     Macro Window and Key Entering

 

 

The macro window shows the recorded (or loaded) macro. To record keys, the button 'Append Recording' must be pressed. Keys pressed with an active button 'Append Recording' will be shown in this window and can later be replayed and stored to macro-files. The recorded keys, and commands are automatically scrolled through the macro window.

 

While pressing keys the following commands are added to the macro:

 

Key

Code

characters like Abc

Abc

BACKSPACE

{BACKSPACE}

BREAK

{BREAK}

CAPS LOCK *)

{CAPSLOCK}

NUM LOCK *)

{NUMLOCK}

SCROLL LOCK *)

{SCROLLLOCK}

PRINT SCREEN

{PRTSC}

SHIFT  *)

{SHIFT}

CTRL   *)

{CTRL}

ALT *)

{ALT}

 

 

DEL

{DELETE} or {DEL}

END

{END}

ENTER

{ENTER}

ESC

{ESC}

HELP

{HELP}

HOME

{HOME}

INS

{INSERT}

DOWN ARROW

{DOWN}

LEFT ARROW

{LEFT}

PAGE DOWN

{PGDN}

PAGE UP

{PGUP}

RIGHT ARROW

{RIGHT}

UP ARROW

{UP}

TAB

{TAB}

 

 

F1

{F1}

F2

{F2}

F3

{F3}

......

 

F11

{F11}

F12

{F12}

 

 

ENTER on NumPad

{{NumPadEnter}

/ on NumPad

{{NumPadSlash}

* on NumPad

{{NumPadAsterisk}

- on NumPad

{{NumPadMinus}

+ on NumPad

{{NumPadPlus}

.  on NumPad

{{NumPadDot}

0 on NumPad

{{NumPad0}

1 on NumPad

{{NumPad1}

2 on NumPad

{{NumPad2}

3 on NumPad

{{NumPad3}

4 on NumPad

{{NumPad4}

5 on NumPad

{{NumPad5}

6 on NumPad

{{NumPad6}

7 on NumPad

{{NumPad7}

8 on NumPad

{{NumPad8}

9 on NumPad

{{NumPad9}

 

 

Windows Key:

{{WindowsKey}

ContextMenu Key

{{WindowsDropDown}

 

Italic commands cannot be recorded by the Recorder. Italic commands containing a *) do not work as expected. As a replacement the recorder commands like {{ScollLockOn, {{Shift.. etc. respective ^,%,+ can be used.

 

When you want to use CTRL character, SHIFT character or ALT character, type them in as usual during recording. ‘Mouse and Key  Recorder’ adds the right commands.

 

Key

Code

SHIFT

+

CTRL (CONTROL)

^

ALT

%

 

Examples: +^h = Shift Control h, +^%{F1} = Shift Control Alt F1

+(EC) = Keep shift down and click E and C. ^%2 = @ (^% represents Alt Gr)

For more ways to enter CAPS LOCK, NUM LOCK, CTRL, Shift, Alt see the commands {{CapsLock, {{NumLock, {{CTRL, {{Alt and {{Shift in chapter "Adding Commands"

 

Some characters are treated specially in the 'Mouse and Key Recorder'. These characters are:

The plus sign (+), caret (^), percent sign (%), tilde (~),parentheses ( ) brackets ([ ]) and brace ({}). All these characters need to be enclosed by braces. {+},{^},{%},{~},{(},{)},{[},{]},{{},{}}

The quotation mark (") acts as a control character in a file. Therefore it is replaced by another character. Example: (å)

 

Hints: 

 

By default, the 'Mouse and Key Recorder' records both, mouse clicks and keystrokes. If you just want to record just the keystrokes it is possible to switch off the mouse recording in the Tools menu ('Tools' / 'Options' / 'Recording' / 'Record Mouse Events')

 

During recording you can add a delay command by using a hot key (CTRL SHIFT ALT and then a number between 0 and 'm'). If the default hot key does interfere with your application you can change it in the Tools menu. ('Tools' / 'Options' / 'Edit / 'Use Hotkeys for insert…')

Important: The hotkeys just work if the option "Hotkeys activated" is switched on in the Recorder options. (Menu: Tools / Options / Tab: General)

 

Delay key assignments: 1: 300 ms, 2: 500 ms, 3: 750ms, 4: 1min, 5: 2min, 6: 5min, 7: 10min, 8: 15min, 9: 50min, 0: 1hour; q: 1sec, w: 2sec…..o: 9sec; p: 10sec; a: 11sec, s: 12sec….l: 19sec; y/z: 21sec, x: 22sec….m: 27sec.

 

 

1.9.2     Loading and Storing Macros

 

         

 

You can load existing macros by the menu 'Open…'. Already  loaded or saved macros can be found above the menu 'Exit'. The yellow-grey folder in the toolbar also allows you to open a macro. For fast prototyping a macro the two commands 'Load Temporary' and 'Save Temporary' are handy. These two command can also be found in the toolbar (grey arrows). Important: During 'Temporary Macros' - Open and Save no warnings are shown, even when changes are overwritten!

The commands 'Save' and 'Save as' let you save a macro. By using 'Save as' an existing macro can be saved with another name. In the toolbar the little disk serves as 'Save'.

 

 

1.9.3     Start or Switch to an Application

 

 

The 'Mouse and Key Recorder' always works on other applications. Therefore it has to switch to another application or to open a new application. To switch to an application the name of the application as it appears by pressing ALT TAB has to be put into the line: 'Switch to Window'.

Example: Document2 - Microsoft Word. Often Microsoft Word is enough to be able to switch.

If an application should be started, the whole path has to be entered to line: 'Start Application'. Example: C:\PROGRAMS\MSOFFICE\WINWORD\WINWORD.EXE.

If the 'Start Application' and 'Switch to Window' are empty, no switch or start is carried out.

Commands {{Switch and {{Start

Starting or switching to an application as described in this chapter is only carried out once after starting the macro. If you want to start or switch to applications during the macro run, you need to use the commands: {{Start or {{Switch.

 

 

1.9.4     Loops

 

 

Often an activity has to be repeated several times. Example: Copying content of 100 E-Mails to a WinWord document. The 'Loops' control lets you set how many times the macro is repeated. For Loops max 9 digits can be used.  In this example the whole macro is run 3 times. Sometimes certain activities should be carried out only at the first or at the last loop. The following commands allow doing this:

{{1}Start C:\MSO\Word.exe. Here WinWord is started only during the first loop

{{n}%fe.                      Only during the last loop WinWord is closed

{{2}I'm line two            Only during loop 2 the text is written.

{{<10}Filename00       Always during loops lower than 10

 

Sometimes the loop number is needed. Example: You want to open File1.txt, then File2.txt... For that purpose you can use: {{Loop}. This command adds the loop number.

Example: {{Start Notepad.exe File{{Loop}.txt.

If your files start at 101 you can use an offset.

Example: {{Offset 100}. During the first run file101.txt will be opened.

Disadvantage: If the total number of Loops is e.g. 150 the macro repeats 150 times despite of the {{Offset 100}. The command {{SetLoop 101 avoids this disadvantage.

 

Another often-needed function is to go up or down with the cursor for a certain amount. Example: During every loop the cursor should be put down one time more. The following command lets you do this: {{DownLoop. During loop 1 the down cursor is activated once, during loop 2 the down cursor is activated twice... The command {{RightLoop does the same but moves the cursor to the right.

 

Loops can also be created by using command {{Goto.

 

 

1.9.5     Adding Commands

 

   

 

 

The button 'Insert' / 'Command…' (resp. Toolbar icon: {{.. ) opens a Command-Input window. Here special commands can be chosen. After clicking on one of the commands, the command is entered in the lower edit field, the second text field tells you what has to be added, and the third text field sometimes gives you some hints. If the check box ‘Add’ is marked, every chosen command is added to the already existing one in the edit field.

The 'Add Command' window has a further built in automation. You can start to enter a command (example: setg..) The marker in the list jumps to the appropriate line. With a CTRL M the command is filled in. As soon as you check ‘Add’ the same process is started for the second command. (Example: {{SetGlobVar1} {{lo...  . This automation has a side effect. The cursor key does not work properly any more. If you want to use the cursor key (to enter text in the middle of a line) you can switch off the automation by the key CTRL N.

If a command requires a path and filename a further button (Browse) appears. The path and filename chosen by browsing is then added to the edit field.

Hints:

If you add a command-line without {{ at the beginning of the line, then all special characters like [, ], +, %, ^ … are converted for output ( {[}, {]}, {+}, {%}, {^}..)

The window 'Insert Command' does not contain all existing command. (Just the most used ones). Chapter 'Special Commands' contains additional commands.

Spaces in the commands (see examples) are important. If you omit them,  you will get error messages.

The command order in the window 'Insert command' can be changed in the options to alphabetical.

 

1.10     All Commands

 

Using parameters in commands

 

The 'Mouse and Key Recorder' lets you use certain commands as a parameter for other commands. Example: {{Start {{StringFileName}. The command {{Start starts an application. The variable {{StringFileName} contains the file name. More Examples:

Rules:

{{If {{FindFile {{String1}} = {{True} ;;{{ShowError}

{{SetGlobVarRandom } {{RandomNumber {{VarLow}, {{VarHigh}}.

{{CR} and {{LF} can be used as often as you want it in a line.

 

Important: It is not possible to use any text or other commands after an output-command located at the beginning of the line. Example (WRONG):
{{String1} is member of department {{String2}.
You need to rewrite this line the following way:
{{String1}
 is member of department {{String2}

 

Important: Commands not used as parameters and containing text must not be enclosed with a bracket. Examples:

{{SetString1} MyText  

{{Switch Document2 Microsoft Word

 

 

1.10.1     Command Descriptions

 

1.10.1.1     {{' Text, {{'' Text

Lets you enter a comment. Comments can be entered anywhere in a command line. All text after {{' or {{‘’ will be ignored. Important: All text before a {{‘’ will be used. Example: {DELETE}  {{‘’ delete this line. Result: The marked line will be deleted but you get two additional spaces ! If you do not want the additional spaces use {{‘ delete this.... The command {{‘ kills all spaces before {{‘

Hint: Do not use quotation marks. ("), use two apostrophes for the command {{'' Text

 

1.10.1.2     {{SendTextSpecial}, {{SendTextNormal}

{{SendTextSpecial} and {{SendTextNormal} give you the opportunity to choose the text output mode. By default (Normal) all texts are given out by the VB-Command 'SendKeys'. The command {{SendTextSpecial} changes the output to the API-command 'keybd_event'. Both modes have advantages and disadvantages:

{{SendTextNormal}:

Advantage: After each character the macro waits until the application has processed the character, only then the next character is sent. That way no special delays are necessary for text outputs. (Important: This is not any longer valid for Windows Vista/Win7. Microsoft has partly removed this waiting :-(  )

Disadvantage: This Normal-output does sometimes not work for exotic Internet forms or old programs like old SAP windows. Special characters like +, %, ^, etc, needs to be covered by braces. Example {+}

{{SendTextSpecial}:

Advantage: The text output works also in old programs and Internet forms.

Disadvantage: The characters are given out immediately. (The macro does sometimes not wait until an application has processed the character). Therefore for {{SendTextSpecial} a careful delay management is recommended.

Hints:

The {{SendTextSpecial} mode is active after the line where the command is placed in the macro. It stays active until the command {{SendTextNormal} appears or until the end of the macro (if no {{SendTextNormal} appears). Macros loaded by {{LoadMacro start again in Normal mode.

It is recommended to use {{SendTextSpecial} just for critical parts like stubborn Internet forms.

{{SendTextSpecial+}

{{SendTextSpecial+} allows giving out text without the need of special treatment of special characters. The special characters: +,^,%,~,(,),[,],{,} are given out normal, that means these characters do then not have the usual effect like ALT SHIFT, CTRL..

Exceptions: {{ are still interpreted as command. Example: Line1{{CR}Line2: The {{CR} generates a line break. The special characters ^, ~,` are just given out correctly if the option "Hotkeys activated"  is switched off. (In other languages other characters might be act wrongly. Affected are the characters which can be combined like ^ and an a => â)

The Special+ mode can be deactivated by using {{SendTextNormal} or {{SendTextSpecial}.

 

 

1.10.1.3     {{WindowsAeroOff}, {{WindowsAeroOn},

Lets you switch on and off Windows Aero (Aero-Glass-Mode).

 

1.10.1.4     {{GetAeroState}

Reads the state of the Aero-Glass-Mode. This can be used to decide if it is necessary to use {{WindowsAeroOff} and {{WindowsAeroOn}. This command can only be used as parameter. That means it must not start at the beginning of a line. Example for a parameter use: {{If {{GetAeroState} = {{True} ;…..

 

1.10.1.5     {{Start, {{StartAndWait

Lets you start an application. You need to enter the full path and the filename. Example: {{Start "C:\Program Files\MyFolder\MyProgram.exe"

Exception: If your application is covered by your environment variable 'Path=', only the application is necessary. Example: {{Start Notepad.

Hints: If you need to define the working directory, carry out {{SetWorkingDir before you use {{Start.

{{Start can only start files with the extension .exe, .bat, .com. For data files like .doc the filename can be added (as command line) to the application path. Example: {{Start "C:\Program Files\Microsoft Office\Office\WINWORD.EXE" D:\MyDocuments\MyWordFile.doc

Another way is to start the application (here MS Word). Then load the .doc file by the appropriate commands (ALT File….)

Paths and filenames, which contain spaces, needs to be wrapped with quotation marks. Example: {{Start "C:\Program Files\Microsoft Office\Office\WINWORD.EXE" "D:\My Documents\MyWordFile.doc"

{{StartAndWait: If you want to wait for the started application to end, before the macro continues, you can use the command: {{StartAndWait. Example: {{StartAndWait Notepad. Result: Notepad is started and the macro waits until Notepad is closed.

Hint: {{StartAndWait allows just starting a program, adding a command line is not possible. Workaround: Just use the data file and the corresponding program starts. Example: {{StartAndWait C:\MeineDateien\John.TXT. In this example Notepad is started and John.txt is opened. 

 

1.10.1.6     {{SetCurrentDir

Some applications need the right working directory for a proper function. Often the load and store function uses the working directory as a default location.

Example: {{SetWorkingDir C:\Programs\Office. Result: The next {{Start or {{SwitchOrStart command uses 'C:\Programs\Office' as working directory.

 

1.10.1.7     {{DOS

Lets you carry out a DOS command. Example: {{DOS del c:\myFile.txt. Important: {{DOS does only support 8.3 paths and filenames. (Max. 8 characters for the filename, max 3 characters for the extension.) This restriction can be avoided by using {{Start CMD. This opens a DOS box which allows longer paths and filenames.

Hints: Use the normal Recorder file commands if you need to delete / rename / copy files or directories with long filenames. Normal Recorder file commands: {{CopyFile, {{DeleteFile, {{RenameFile {{CreateDir, {{CopyDir, {{DeleteDir.

 

1.10.1.8     {{Switch

Lets you switch to another application. Use the name you find when you press ALT TAB. You can use only a part of the name, but that part must be unique. Example: Alt Tab Text: Recorder2000.doc - Microsoft Word. Switch command: {{Switch Microsoft Word. Sometimes also the dash (- Microsoft Word) is needed. You might need to experiment what Windows accepts.

Important: The {{Switch command removes leading and tailing spaces. If you want to keep these spaces, place the command {{KeepSpace} before the {{Switch command.

Hints:

Hotkey: {{Switch is a command, which is needed quite often. Therefore the 'Mouse and Key Recorder' offers a second way (Hotkey) to add switch commands. Procedure: Activate recording, switch to your window by using ALT TAB. Press the following keys all together: CTRL-ALT-SHIFT-F12 and then again F12. A {{Switch command is added to your macro. It is possible to change the hotkey and to filter the window names. See chapter 'Options' for more information.

New Switch Technique: Version V5.0 introduced a new technique for switching. This technique should work more reliably also for "difficult" applications. In case an old {{Switch command does not work any longer with the new version, you can use {{UseOldSwitch} to go back to the old switching technique for the actual macro. {{UseNewSwitch} brings you back to the new switching technique.

Second Window: If the Mouse and Key Recorder starts an application and this applications starts itself a new application window, then sometimes {{Switch can not activate this new window. In such a situation the command {{UseForeground} might help. (The right to bring a window on top is then inherited from the foreground window). {{UseRecorder} can be used to go back to the original switch function.

Wrong Window found: If a window has just a short name like Editor it might happen that another window (e.g. Microsoft Visual Basic Editor - MKR) is found and activated. This can be avoided by using the two additional commands <= and =>.  <=Editor means just a window with the word Editor located at the beginning of the name will be activated. Editor=> means just a window with the word Editor located at the end of the name will be activated.

Window with no name: You can switch to a window without a name by using: {{Switch #emptyX5#. (#emptyX5# is case sensitive)

Mouse and Key Recorder:

With V5.4 (and later) it is not any longer possible to switch to the Mouse and Key Recorder by using the command {{Switch. If you want to activate the Mouse and Key Recorder you need to use the symbolic name: #MKRX5#. Example: {{Switch #MKRX5#

 

1.10.1.9     {{SwitchOrStart

This command first tries to switch to an application window. If the application window does not exist, the command starts the application. Example: {{SwitchOrStart Microsoft Word | C:\Programs\Office\Word.exe. If WinWord is open the 'Mouse and Key Recorder' switches to it, otherwise it starts the application.

Hint: The {{SwitchOrStart command removes leading and tailing spaces. If you want to keep these spaces, place the command {{KeepSpace before the {{SwitchOrStart command.

See also {{Switch and {{Start for additional options.

 

1.10.1.10     {{Loop}

Lets you output the loop number. Remark: One Loop is always a fully repeated macro. The total amount of Loops can be set on the Recorder form ('Loops'). Example:

{{Switch Microsoft Word

This is loop number {{Loop}

Keep in mind: The command {{Loop is not a Loop-construct like in VisualBasic. To repeat a macro you need to set the number of repetitions in the edit-window 'Loop Macro' at the bottom of the 'Mouse and Key Recorder' Window.

The command {{Loop is just used to output the actual Loop number. (Number of repetition)

Hint: Instead of Loops the command {{Goto can be used to repeat the whole macro or parts of the macro.

 

1.10.1.11     {{LockUI

This command allows to block mouse and keyboard temporarily. Macros which use mouse clicks can be disturbed considerably when the real mouse is moved during macro run. Syntax: {{LockUI {{True} (or {{LockUI 1): Mouse and keyboard are locked. {{LockUI {{False} (or {{LockUI 0): Mouse and keyboard are released. The lock is also released when the macro ends. Additionally the lock can be released by using CTRL ALT DEL.

Important: {{LockUI works in Windows Vista and newer just when the Mouse and Key Recorder is started as administrator. This can be achieved by right click on the Recorder icon and choosing "Run as Administrator"  It is also possible to change the icon: By setting "Run with highest Privileges" (Properties, Tab: General) the Recorder starts as Administrator automatically. This still causes a dialog window. If you want to avoid this window, you can use the following trick: Enter a task in the Task Scheduler (which starts the Recorder) with the option "Run with highest Privileges" Example: DirectoryName\Taskname: MyTasks\Recorder. You can then call this entry by an icon with the command line: C:\Windows\System32\schtasks.exe /RUN /TN "MyTasks\Recorder"

If you start a macro by a hotkey and this macro contains a {{LockUI} you need to add a delay at begin of the macro. Otherwise the release of the hotkey might already be blocked. This would then cause a wrong keyboard behavior.

The commands {{CapsLock… and {{NumLock… are also blocked when {{LockUI is used. That means those two commands needs to be used before {{LockUI is enabled or {{LockUI needs to be deactivated during those commands.

 

1.10.1.12     {{SetLoop

This command lets you change the actual loop counter. Example: {{SetLoop 100. The next {{Loop command (in the same loop) will provide 100. If the total Loop number is set to 150 the macro will end after 50 loops.

 

1.10.1.13     {{Offset

Adds an offset to the loop number. Example: {{Offset 100}: The first loop will enter (above example): This is loop number 101.  If the total Loop number is set to 150 the macro will anyway end after 150 loops. ({{Loop shows then 250}

 

1.10.1.14     {{1}

All commands after {{1} will only be carried out during the first loop.

Example: {{1}{{SetVarCounter 1. Variable 'Counter'  is set to one just during the first loop.

Hint: An offset is taken into account in this command. The offset is added to the actual loop. Example: {{Offset 5: In this case the first run has already Loop no 6 and therefore a command after {{1} will never be carried out.

 

1.10.1.15     {{8}

All commands after {{8} will only be carried out during the eighth loop.

Example: {{8}{{SetStringHint Loop eight reached. The text variable 'Hint' is filled with a text just during loop eight.

Hint: An offset is taken into account in this command. The offset is added to the actual loop Example: {{Offset 5: During real loop 3 the command after {{8} will be carried out.)

 

1.10.1.16     {{<8}

All commands after {{<8} will only be carried out during all loops less than 8 (1, 2, 3.. 7).

Example: {{<8}{{IncVarCounter 1. The variable 'Counter' is increased by one just during the first 7 loops.

Hint: An offset is taken into account in this command. Example: {{Offset 5: A command after {{<8} will be carried out during real loop 1 and 2 corresponding to 6 and 7)

 

1.10.1.17     {{>8}

All commands after {{>8} will only be carried out during all loops higher than 8 (9, 10, 11, etc.).

Example: {{>8}{{IncVarCounter 1. The variable 'Counter' is increased by one just during loops 9, 10, 11 and higher.

Hint: An offset is taken into account in this command. Example: {{Offset 5: A command after {{>8} will be carried out during real loop 4, 5, 6 etc. corresponding to 9, 10, 11, etc.)

 

1.10.1.18     {{n}

All commands after {{n} will only be carried out during the last loop.

Example: {{n}{{MessageBox Last run. The text: 'Last run' is just shown during the last loop.

Hint: An offset is NOT taken into account in this command. {{n} is always carried out during the last loop regardless of the content of offset.

 

1.10.1.19     {{Beep}

This command produces a sound. {{Beep} can be used to inform you that the macro has ended.

 

1.10.1.20     {{MessageBox

{{MessageBox shows a text to the user. Example: {{MessageBox Please insert CD. {{CR} CD must not be copy protected !

The {{CR} keyword allows you to show more than one line for the text. Important: After the command {{MessageBox a command {{Switch.... must follow, otherwise the Recorder will continue with the focus on itself !

 

1.10.1.21     {{FlashBox

{{FlashBox shows like Message Box a text to the user. But the user does not have to click OK. The command allows to change the text and to close the FlashBox by a similar macro command. Examples: {{FlashBox This is my first Text | 1.  The box appears, and shows the text. {{FlashBox Now I showing you my second Text | 1.   The box stays, but the new text is shown. {{FlashBox Dummy | 0The box disappears. (For removing the box any text can be used. In our example we use 'Dummy')

Optionally further parameters can be used. These are: Box-Title, an OK-button, and a cancel-button. Example: {{FlashBox Please check the result. Is it ok ? | 1 | Question | YES | NO.  This command produces a box with the title: 'Question', the text: 'Please check the result. Is it ok ?', a YES-button and a NO-button. If the user clicks YES (first button) the variable VarFlashBoxAnswerX55 is set to {{True}. If the user clicks NO (second button), VarFlashBoxAnswerX55 is set to {{False}. Additionally the variable VarFlashBoxEndedX55 is set to {{True}, if YES or NO was clicked. If neither YES nor NO was clicked and the FlashBox ends, then VarFlashBoxAnswerX55 contains the value {{True}.

Here an example how this functionality could be used:

{{SetVarCounter 0

{{FlashBox Please check the result. Is it ok ? | 1 | Question | YES | NO

{{Label Again

{{Delay 1000

{{IncVarCounter 1

{{If {{VarCounter}  >= 10 ;{{Goto Continue;

{{If {{VarFlashBoxEndedX55} = {{True} ;;{{Goto Again

{{Label Continue

{{FlashBox Dummy | 0

{{If {{VarFlashBoxAnswerX55} = {{True} ;{{MessageBox YES was clicked, or 10 sec. expired;

{{If {{VarFlashBoxAnswerX55} = {{False} ;{{MessageBox NO was clicked;

The location of the FlashBox is saved. So the flash box appears always at the last location. If the location is outside the primary screen then the FlashBox is moved inside the screen. If this behavior not wanted (e.g. if a multi screen is used) it can be switched off. Just start the Reg-File: www.kratronic.com/tools/recorder/sw/FlashBoxBorderOff.reg. (Switching on again: FlashBoxBorderOn.reg)

Hint: If the Recorder starts another program, then the Flashbox can be shown behind the window of the other program. In this case the Flashbox needs to be located outside this window.

 

1.10.1.22     {{ShowInfo

{{ShowInfo allows to show a text in the macro description field of the Recorder (Tab 'General'). Syntax: {{ShowInfo MyText. The original description text is restored when the macro ends. This command can be used to show additional status information, e.g. counter status, loop number when using {{Goto, etc.

 

1.10.1.23     {{WaitForKey

This command waits for any keystroke. The macro stops and waits for a keystroke (e.g. SHIFT or any character key). Then the macro continues.

The value of the pressed key is saved in the variable: {{StringWaitForKeyX55}. Hint: Only one key is saved, e.g. a, ü, RIGHT, F3, ALT. Combinations like ALT-a  are not possible.

 

1.10.1.24     {{Stop}

When the Recorder comes across a {{Stop} a window is shown which gives you the possibility to continue immediately, to stop, to continue with the next loop or to continue with the next {{Master} command.

Hints: If you want to be able to continue you must place a {{Switch-command after {{Stop}. Reason: Stop places the focus to the Recorder window.
See also chapter: Debugging: (Emergency stop: ALT Break, Pause: Shift Break)

Important: {{Stop} must not be used after a {{Minimize} command. Otherwise the Stop-window cannot be closed anymore on certain operating systems.

 

1.10.1.25     {{Exit}

Closes the 'Mouse and Key Recorder'. If a change was made on the macro, the Recorder first asks whether this macro should be saved. This function is especially handy if you start a macro by command line (example: by icon). An {{Exit} at the end of the macro causes the 'Mouse and Key Recorder' to disappear after the task is done.

 

1.10.1.26     {{Var}, {{GlobVar}

Lets you use variables. Variables must be set by {{SetVar.. or {{SetGobVar.. before you can use them.

Example for Var: {{VarMyVariable}: The content of variable "MyVariable" will be written.

{{Var-variables are stored together with the macro to a file, {{GlobVar-variables are stored only once. That means you can use the same global variable in all your macros. All variables survive a PC-boot.

You can use as many variables as you want. Example {{Var56345}. Variable names are not case sensitive.

If you use a variable not yet set, you get a zero as the result. It is no longer allowed to omit the number or name after {{Var. (Incompatibility to versions earlier than V5.0)

 

1.10.1.27     {{SetVar, {{SetGlobVar

Lets you set number variables. Example: {{SetVarMyNumber} 25: Variable "MyNumber" will be set to 25. You can also use decimal values: {{SetGlobVar15} 12.5. Important: Only numbers can be stored by variables, no string (text) is possible. For decimal values only a dot is allowed as decimal point. {{Var-variables are stored together with the macro. You can use as many variables as you want. Examples {{SetVar56345} or {{SetVarMyCounter. (Variable name is not case sensitive).

{{Var-variables are stored together with the macro to a file, {{GlobVar-variables are stored only once. That means you can use the same global variable in all your macros. All variables survive a PC-boot.

It is no longer allowed to omit the number or name after {{SetVar. (Incompatibility to versions earlier than V5.0)

Hint: Certain variable names are used for commands, which return more than one value e.g. {{GetWindowPos. The following names should not be used for your own variables:

{{VarGetWinCoord_X, {{VarGetWinCoord_Y , {{VarGetWinCoord_X_End, {{VarGetWinCoord_Y_End,  {{VarGetCursorCoord_X, {{VarGetCursorCoord_Y, {{VarFindPatternCoord_X_... {{VarFindPatternCoord_Y_..., {{VarFindPattern_Numbers, {{VarFlashBoxEndedX55, {{VarFlashBoxAnswerX55, {{VarFlashBoxAnswerX55, {{StringWaitForKeyX55, {{VarScanDirectoriesX55, {{VarAskX55, {{StringAskCheckBoxX55_0..6, {{VarAskCheckBoxX55_0..6.

 

1.10.1.28     Increment, Decrement, Multiply and Divide

{{IncVar,  {{IncGlobVar

{{DecVar,  {{DecGlobVar

{{MulVar,  {{MulGlobVar

{{DivVar,  {{DivGlobVar

Lets you change your variables. Examples:

{{IncVarCounter} 5: adds 5 to the variable "Counter"

{{DecGlobVarCounter} 5: subtracts 5 from the global variable "Counter"

{{MulVar1} 10: Multiplies variable 1 by 10

{{DivVar1} 10: Divides variable 1 by 10. (Real-Division)

See also Command {{Calc.

Hint: The above commands just work with a dot as decimal point, independently of the regional settings. If necessary the decimal point needs to be changed by the command {{Replace

 

1.10.1.29     {{String}, {{GlobString}

Lets you use string variables. String variables must be set by {{SetString.. or {{SetGlobString.. before you can use them.

Example for string: {{StringMyText}: The content of string variable "MyText" will be written.

{{String-variables are stored together with the macro to a file, {{GlobString-variables are stored only once. That means you can use the same global variable in all your macros. All variables survive a PC-boot.

You can use as many variables as you want. Example {{String56345}. It is also possible to use strings with names. Example: {{StringMemberName}. Variable names are not case sensitive.

If you use a variable not yet set you get a "0" as result. It is not any longer allowed to omit the number or name after {{String. (Incompatibility to versions earlier than V5.0)

Hint: If you want to store/use large amounts text you might get an error when you output it by {{String.. Workaround: Use {{SendTextSpecial} or even better move the text to Clipboard and use it by CTRL v

 

1.10.1.30     {{SetString}, {{SetGlobString}

Lets you set string variables. Example: {{SetStringMyGlobalText} My Text: String variable "MyGlobalText" will be set to "My Text". Variable names are not case sensitive.

Carriage Returns and Line Feeds can be added to your string by using the two key words: {{CR} and {{LF}. These two characters are handy if you want to use text containing more than one line. Example: {{SetString1} Line one{{CR}{{LF}Line two. For certain programs just a {{CR} is necessary. An empty string ("") can be set by using the constant: #emptyX5#. Example: {{SetString1} #emptyX5#. A string containing just a space can be set by using the constant #spaceX5#. Example: {{SetString1} #spaceX5#. (#emptyX5# and #spaceX5# are case sensitive)

{{String-variables are stored together with the macro to a file, {{GlobString-variables are stored only once. That means you can use the same global variable in all your macros. All variables survive a PC-boot.

It is not any longer allowed to omit the number or name after {{SetString. (Incompatibility to versions earlier than V5.0)

Hint: Certain variable names are used for commands, which return values in a variable e.g. {{WaitForKey}  The following name should not be used for your own variables: {{StringWaitForKeyX55}. Further on the variable name must not contain a = (Equal sign).

 

1.10.1.31     {{Ask},  {{GlobAsk}, {{WriteAsk},  {{WriteGlobAsk}

The command {{Ask.. allows asking the user for input. {{Ask supports input as text, by CheckBoxes, by RadioBoxes and by ComboBoxes.

 

 

 

 

 

Syntax for user input as text: {{AskID Prompt |Default_Text | Cancelling_Behavior. Example:  {{AskMyQuestion Please enter your name. {{CR} Don’t forget your first name |Peter Miller| {{True}

The {{CR} keyword allows you to show more than one line for the prompt. The text after the first separator (|) is used as default value. The option after the second separator (|) defines the reaction when you abort the question. Reaction: {{False} or omitting: Abort causes a further form where you can repeat the {{Ask form or ending the macro. Reaction: {{True}: Aborting sets the variable {{VarAskX55} to {{True} and the macro continues. That way you can react to an abort in the macro according your needs. (The default value and abort option are optional, you can omit them.)

The result you get by {{Ask.. can then be used by the command {{WriteAsk..}, e.g. {{If {{WriteAsk1} = YES;;{{Goto End

 

Syntax for user input by CheckBoxes: {{AskID CHECKBOX | Selected_Boxes | Cancelling_Behavior.

Example: {{AskMyBoxes CHECKBOX | C3  The prompt text for the boxes needs to be defined beforehand. Specially named variables are used fort hat: {{SetStringAskCheckBoxX55_1..6.

Example

{{SetStringAskCheckBoxX55_1 First CheckBox
{{SetStringAskCheckBoxX55_2 Second CheckBox
{{SetStringAskCheckBoxX55_3……
{{AskMyBoxes CHECKBOX | C3

 

The parameter CHECKBOX in the {{Ask command switches to the CheckBox view. The number after CHECKBOX defines which box(es) will be activated (default). Examples: 2 = Box 2, C3 = Boxes 2 and 3. For an explanation of the C rules see "CheckBox combinations" later on.

 

The variables {{VarAskCheckBoxX55_1..6 show the chosen boxes by {{True} or {{False}. The variable {{VarAskCheckBoxX55_0 shows the CheckBox combinations. For that all box-values are added. Box 1 has the value 1, Box 2 has value 2, Box 3 has value 4, Box 4 has value 8, Box 5 has value16 and box 6 has value 32. A combination of Box 1, 2 and 3 would get the result 7. Because variables are stored to a file, not needed box texts needs to be set back to empty: {{SetStringAskCheckBoxX55_6 #emptyX5#  (#emptyX5# is case sensitive)

 

Syntax for user input by RadioBoxes: {{AskID RADIOBOX | Selected_Box | Cancelling_Behavior.

Example: {{AskMyBoxes} RADIOBOX | 1  The prompt text for the boxes needs to be defined beforehand. Specially named variables are used fort hat: {{SetStringAskRadioBoxX55_1..6.

Example:

{{SetStringAskRadioBoxX55_1 First RadioBox
{{SetStringAskRadioBoxX55_2 Second RadioBox
{{SetStringAskRadioBoxX55_3……
{{AskMyBoxes RADIOBOX | 1

 

The parameter RADIOBOX in the {{Ask command switches to the RadioBox view. The number after RADIOBOX defines which box will be activated (default). Examples: 2 = Box 2.

The variables {{VarAskRadioBoxX55_1..6 show the chosen boxes by {{True} or {{False}. The variable {{VarAskRadioBoxX55_0 shows the chosen RadioBox number. Because variables are stored to a file, not needed box texts needs to be set back to empty: {{SetStringAskRadioBoxX55_6 #emptyX5# (#emptyX5# is case sensitive)

 

Syntax for user input by ComboBox: {{AskID COMBOBOX | Selected_Entry | Cancelling_Behavior.

Example: {{AskMyComboBox} COMBOBOX | 1  The prompt text for the boxes needs to be defined beforehand. Specially named variables are used fort hat: {{SetStringAskComboBoxX55_1..n. You can use as many entries you like.

Example:

{{SetStringAskComboBoxX55_1 First Entry
{{SetStringAskComboBoxX55_2 Second Entry
{{SetStringAskComboBoxX55_3……
{{AskMyComboBox COMBOBOX | 2

The parameter COMBOBOX in the {{Ask command switches to the ComboBox view. The number after COMBOBOX defines which Entry will be activated (default). Examples: 2 = Entry 2.

The text of the chosen entry will be saved in variable {{StringAskComboBoxX55_0

The number of the chosen entry will be saved in variable {{VarAskComboBoxX55_0

Because variables are stored to a file, not needed entries needs to be set back to empty: {{SetStringAskComboBoxX55_6 #emptyX5#  (#emptyX5# is case sensitive)

 

Hints:

For all types of inputs the text input can be used (not just with "user input as text")

If you use an ask-variable not yet set, you get a zero as result.

{{Ask-variables are stored together with the macro. {{GlobAsk-variables are stored just once for all macros. That means GlobAsk variables ({{WriteGlobAsk..) can be used in all macros

The {{Ask-form location and size are stored. That means every time you use {{Ask the last location and size will be used.

The number of {{Ask-variables is not limited. Example: {{Ask56345}.

Important: {{Ask and {{GlobAsk place the focus on the Recorder window. If you want to be able to write again to your application you need to add an {{Switch command after {{Ask or {{GlobAsk.

The Ask-variable name must not contain a = (Equal sign).

 

1.10.1.32     {{SetClipBoard, {{ClipBoard}

{{SetClipBoard} lets you write text from the macro to the clipboard. Example: {{SetClipBoard MyText{{CR}{{LF}MyText second Line.

{{SetClipBoard is also needed if you want to use {{RandomString with special characters. {{ClipBoard} works nearly the same way as CTRL v for outputting text to an active window. Exception: If the clipboard contains the characters: +, ^, %, ~, (, ), [, ] just CTRL v should be used.

{{ClipBoard} converts the characters {, } to {{} and {}}. If this is not wanted use the command {{ClipBoard0} (ClipBaordNull). {{ClipBoard} can also be used to put text from a clipboard to a variable. Example: {{SetString1} {{ClipBoard}

Hint: Reading the content of the clipboard several times can cause errors e.g. a Runtime error on certain PCs. (internal Windows problem). To avoid this you can copy the content of the clipboard to a variable. After that you use the variable for accessing the value. Sometimes a small delay between the commands also helps.

 

1.10.1.33     {{DownLoop}, {{UpLoop}, {{RightLoop}, {{LeftLoop}

These commands let you move the cursor depending on the loop number. If loop 5 is carried out, the cursor is moved 5 times up (or down, or right, or left). You can add a number to these commands. Example: {{RightLoop 5}. Result: For every loop the cursor is moved 5 places to the right. That means: When the loop counter including {{Offset contains a 7, the cursor is moved 35 places to the right.

 

1.10.1.34     {{DownVar, {{UpVar, {{RightVar, {{LeftVar

These commands let you move the cursor depending on the content of a variable. Examples: {{DownVar {{Var1}, {{RightVar {{RandomNumber 1,10}. You can also use a number in place of a variable. Example: {{RightVar 15}. Result: The cursor is moved 15 places to the right.

 

1.10.1.35     {{DateTime}

Sometimes you want to store lots of files during every loop. The command {{DateTime} produces a text like this: 2010-12-13-23-51-12. Every second you get a different text.

 

1.10.1.36     {{Date}

The command {{Date produces a text like this: 2010-12-13. Every day you get a different text.

If you need the other date format (13-12-2010) you can use the following macro command: {{Right {{Date} | 2}-{{Mid {{Date} | 6 | 2}-{{Left {{Date} | 4}

 

1.10.1.37     {{Time}

The command {{Time produces a text like this: 23-45-59. During a day every second you get a different text.

 

1.10.1.38     {{SerialTime}

The command {{SerialTime returns a number, which represents all seconds since 1st  Jan. 1970. Example for Aug. 20th 2011, 17:40: 1313862025. This command can be used to measure time between commands. An example can be found in chapter: Macro Examples.

Important: This command can only be used as parameter. That means it must not start at the beginning of a line. Example for a parameter use: {{SetVarStartTime {{SerialTime}.

 

1.10.1.39     {{CreateSerialTime

The command {{CreateSerialTime returns a number, which represents all seconds since 1st  Jan. 1970 and a given date/time. Example: {{CreateSerialTime 2011,12,08,18,00,00}. Result: 1323367200

This command can be used to trigger an action at a certain time.

Important: This command can only be used as parameter. That means it must not start at the beginning of a line. Example for a parameter use: {{SetVarStartTime {{CreateSerialTime …}.

 

1.10.1.40     {{AddSerialTime

This command lets you add years, months, days, hours, minutes and seconds to the actual SerialTime. Example: {{AddSerialTime 0001,03,04,05,15,45}. This command adds all the seconds for 1 year, 3 month, 4 days, 5 hours, 15 minutes and 45 seconds to the actual SerialTime. Result: When the actual Serial time is: 1323550505 then the result is: 1363313450.

Important: This command can only be used as parameter. That means it must not start at the beginning of a line. Example for a parameter use: {{SetVarNewTime {{AddSerialTime …}.

 

1.10.1.41     {{PCIdle}

The command {{PCIdle} calculates the PC-idle-time in seconds. The PC-idle-time is the time since the last mouse click or keyboard stroke. Important: This command can only be used as parameter. That means it must not start at the beginning of a line. Example for a parameter use: {{SetVarIdleTime {{PCIdle}

 

1.10.1.42     {{Delay, {{ExtDelay

The 'Mouse and Key Recorder' already contains a command {{Delay. A {{Delay can be entered by clicking the hourglass icon or Menu: 'Insert', 'Delay'. The Delay-default value can be set in the Options, Tab 'Edit', 'Insert Delay'. This Delay has the unit ms (milliseconds). Example: {{Delay 2000: The macro waits for 2 seconds.

For larger delays large numbers have to be entered.

Extended Delay allows you to enter a delay in a more natural way.

Syntax: {{ExtDelay Days:Hours:Minutes:Seconds. 

Example: {{ExtDelay 10:23:59:40}. The resulting delay is: 10 days, 23 hours, 59 minutes and 40 seconds. Other examples: {{ExtDelay 10:15}  = 10 minutes, 15 seconds. {{ExtDelay 15}  = 15 seconds. Maximum delay: 3650 days.

Hint: In Windows 98 and ME the command {{Delay has a resolution of 55 ms. That means if you set a delay of 10 ms the 'Mouse and Key Recorder' anyway waits 55 ms. The more modern operating systems have a resolution of 1 ms.

 

1.10.1.43     {{WaitForTime

If you want to start a part of a macro at a specified time (like a scheduler), the command {{WaitForTime can be used. Syntax: {{WaitForTime Days:Hour:Minute:Second. Example: {{WaitForTime 2:17:15:30. That means the lines after {{WaitForTime are carried out in two days at 17:15 and 30 seconds. Another example: {{WaitForTime 20:30:10  Today at 20:30  and 10 seconds. (Parts which are omitted (here Days) have as default zero). Hint: Days change at midnight.

 

In the example above it is not possible to set the time to the past. Example: Today at 14:00 it is not possible to set {{WaitForTime to 9:00. By using a X at the location for day this restriction can be circumvented. Example: {{WaitForTime X:00:15:30. The macro waits now for a time of 15 minutes and 30 seconds after a full hour (this hour .. if it is not yet a quarter past.. or next hour). Other examples:  {{WaitForTime X:00:00:10. The macro waits for the next (or the same) minutes when the value for seconds is 10. {{WaitForTime X:14:15:00: The macro waits till a quarter past two (PM) today or tomorrow depending what comes first.

 

1.10.1.44     {{RandomNumber

This command creates a random number. {{RandomNumber needs two parameters: Lower border and Higher border. The number you get will be between the two numbers (including the borders). Example: {{RandomNumber 100, 200}. Possible result: 126

 

1.10.1.45     {{RandomString

This command creates a random string. {{RandomString needs three parameters: Number of characters, Lower border, Higher border. The string you get will be "No of char" long and the characters will be between the two borders (including the borders).. Example: {{RandomString 12, a, z}. Possible Result: rhnqlkddcyhu. The command {{RandomString works with the ASCII table. That means you get the following characters outside 0..9, A..Z and a..z: !..0 = !"#$%&’()*+,-./0 9..A = 9:;<=>?@A Z..a = z[\]_`z..~ = {|}~ . If you want to have all small letters and all capital letters in your string you can use the following parameters: {{RandomString 12, az, a}. Possible Result: UOTliVOdGnyo.

Hint: The character 'Space' (and the constant #spaceX5#) can not be used in the command {{RandomString.

Important: If you want to write characters outside of 0..9, a..z and A..Z you must use the following clipboard-technique: (Necessary because the random string can contain characters the Recorder can not handle with its output technique)

{{SetClipBoard {{RandomString 20, !, ~}

^v

If you want to create vowel dominant random strings you can use the parameter a2. Example: {{RandomString 12, a2, a} creates 12 characters from a to z (capital letters and others) in which every second character is a vowel.

See also: {{BracesReplace and {{SendTextSpecial}.

 

1.10.1.46     {{ImportFile, {{ImportSeparator, {{DoImport}, {{ImportNextLine

This commands allow to use "records" in a file to be put to the target application. See chapter: ‘File Import’ for an exact description.

 

1.10.1.47     {{If

This command lets you compare values and strings. Syntax: {{If Expression Condition Expression; Then-action; Else-action. Example: {{If {{VarChoice} = 5;{{Switch Microsoft Word;{{Switch Microsoft Excel. Result: If variable 'choice' contains a 5, the Recorder switches to Word. If variable 'choice' contains any other number than a 5 the Recorder switches to Excel.

The command {{If allows using the following conditions: =, <, >, <=, >=, <>, ||, &&.
=: equal, <: less than, >: larger than, <=: smaller or equal, >=: larger or equal, <>: not equal, ||: or, &&: and.
Important: || and && can only be used for logical comparison: {{True, {{False. Example: {{If {{True} && {{False} ;{{MessageBox Both expressions are true;

 

Important: The condition must always be covered by two spaces: Correct: {{If 1 = 2 ;… Wrong: {If 1=2;.  

Since V7.0 more than one action is possible in the Then or Else part. The separator for the commands is §. Example: {{If {{Var1} = {{True} ;{{SetVar10 15§{{SetVarDecision {{True}§{{Beep};SetVar10 0§{{SetVarDecision {{False}§{{Goto Ende

 

Important:

 

Hints:

{{IfSep, {{GlobString1} <> {{String1},Text: Name; Address; City = wrong,OK.

In the above example a comma is used as separator, therefore a ‘;’ can be used in the text. Important: Do not add a space between IfSep and the separator.

 

1.10.1.48     {{True}, {{False}

These two commands are used in comparisons. (e.g. {{If, {{CompareFiles, {{CheckWindow, etc.) {{True} is represented by a one (1), {{False} is represented by a zero (0).

 

1.10.1.49     {{FindFile

This command searches for a file. Example: {{FindFile c:\MyText.txt. If the file exists, {{FindFile produces a "1" if the file does not exist you get a "0". You can use this command together with {{If. Example: {{If {{FindFile C:\MyProgram.exe} = {{True};{{Start C:\MyProgramm.exe;{{Goto Error. For the action the reserved word {{ShowError} can be used. If case on an error an error-text is shown and the macro ends. {{FindFile allows using wildcards (e.g. *.txt). Hint: By using *.txt the next TXT file on the hard disk is found (this might not be the fist according alphabet sorting.)

 

1.10.1.50     {{CompareFiles

This command lets you compare files. If the files are identical, 'CompareFiles' produces a "1" if the files are not identical you get a "0". You must use this command together with {{If. Example: {{If {{CompareFiles C:\MyFile1.txt | C:\MyFile2.txt | 10000} = {{False} ;{{DeleteFile C:\MyFile2.txt; Result: If the two files are different (False) the file 2 is deleted.

The number after the two file names defines how many bytes are compared. If the number is shorter than the file size only the defined amounts of bytes are compared. If the number is larger than the file size, the whole files are compared. For the action the reserved word {{ShowError} can be used. If case on an error an error-text is shown and the macro ends.

 

1.10.1.51     {{ScanDirectories

This command lets you scan a directory (including subdirectories). The result of the scan (found files) are written into a text file. Syntax: {{ScanDirectories Path_being_searched | Search-filter | Including_subdirectories | Result-text-file_path | Several-parts_in_result-text-file. The last part (Several-parts in result-text-file) is optional. If it is omitted, {{False} is used.

Example: {{ScanDirectories C:\MyData | *.Doc | {{True} | C:\Temp\DirList.txt | {{True}. In this example the path: C:\MyData is searched for all Doc files. The command searches also in all subdirectories ({{True}). The found Doc file paths are stored in file: C:\Temp\DirList.txt. Because of the last {{True} not just the path and file are stored but the following parts: Path and file including extension, file including extension, file without extension, extension, path without file. The parts are separated by a >. That means for reading the parts by {{DoImport an {{ImportSeparator > must be defined before {{DoImport. This is also necessary for a DirList with just path and file. Reason: A filename can contain a comma and this would then be a separator in {{DoImport.

The number of files found by {{ScanDirectories are saved into the variable {{VarScanDirectoriesX55}

The search filter can contain *, ?, #, !, [ and ] for filtering the result.

 

Kind of match

Pattern

Match

No match

Multiple characters

a*a

aa, aBa, aBBBa

aBC

 

*ab*

abc, AABB, Xab

aZb, bac

Special character

a[*]a

a*a

aaa

Multiple characters

ab*

abcdefg, abc

cab, aab

Single character

a?a

aaa, a3a, aBa

aBBBa

Single digit

a#a

a0a, a1a, a2a

aaa, a10a

Range of characters

[a-z]

f, p, j

2, &

Outside a range

[!a-z]

9, &, %

b, a

Not a digit

[!0-9]

A, a, &, ~

0, 1, 9

Combined

a[!b-m]#

An9, az0, a99

abc, aj

 

 

1.10.1.52     {{CreateDir

This command creates a directory. If the directory already exists, nothing is done. If the path is invalid, nothing is done. It is possible to create just one level or a whole tree. Example: {{CreateDir C:\MyDir\MyLowerDir\MyLowestDir

 

1.10.1.53     {{CopyDir

{{CcopyDir copies a directory. Example: {{CopyDir C:\MyDir1 | C:\MyDir2. If the target directory not yet exists, it will be created. Files already existing in the target directory are overwritten. If just files shall be copied which are not existing in the target directory then the following syntax can be used: {{CopyDir C:\MyDir1 | C:\MyDir2 | {{False}. Hint: The whole directory with subdirectories will be copied.

 

1.10.1.54     {{DeleteDir

This command deletes a directory. Example: {{DeleteDir C:\MyDirectory. If the directory does not exist, nothing is done. If the path is invalid, nothing is done.

The above command deletes just empty directories. If a not empty directory needs to be deleted, then the following command can be used: {{DeleteDir C:\MyDirectory | {{True}. But if the directory contains read only files or locked files the directory will anyway not be deleted. To find out why a directory can not be deleted the following command can be used: {{DeleteDir C:\MyDirectory | 2. This is equivalent to {{DeleteDir C:\MyDirectory with error information. {{DeleteDir C:\MyDirectory | 3. is equivalent to {{DeleteDir C:\MyDirectory | {{True} with error information.

 

1.10.1.55     {{CopyFile

This command lets you copy (and the same time rename) files. Syntax: {{CopyFile SourceFile | TargetFile | Wildcard: Yes/No. Example {{CopyFile C:\My Documents\ReadMe.txt | C:\Your Documents\Hints.txt | {{False}. When Wildcard: {{False}  then always a full file name including path is needed. (Wildcards are not possible). When Wildcard: {{True} wildcards can be used. Important: If wildcards are used the target file must be defined as *.*. (Otherwhise found files are all copied to the one target file). Simplification: If the source file contains a * or ? then automatically *.* is used for the target file. (but not in case of e.g. #). The parameter Wildcard is optional. If it is omitted {{False} will be used.

The source file can contain *, ?, #, !, [ and ] for filtering the result.

 

Kind of match

Pattern

Match

No match

Multiple characters

a*a

aa, aBa, aBBBa

aBC

 

*ab*

abc, AABB, Xab

aZb, bac

Special character

a[*]a

a*a

aaa

Multiple characters

ab*

abcdefg, abc

cab, aab

Single character

a?a

aaa, a3a, aBa

aBBBa

Single digit

a#a

a0a, a1a, a2a

aaa, a10a

Range of characters

[a-z]

f, p, j

2, &

Outside a range

[!a-z]

9, &, %

b, a

Not a digit

[!0-9]

A, a, &, ~

0, 1, 9

Combined

a[!b-m]#

An9, az0, a99

abc, aj

 

1.10.1.56     {{RenameFile

This command lets you rename (and move) files.

Example {{RenameFile C:\Data\ReadMe.txt | C:\Data\Hints.txt.

If your paths are different the file is also moved to the destination path. Always a full file name including path is needed. (Wildcards are not possible). It might not be possible to use different drives for source and destination file. (Operating System depending)

 

1.10.1.57     {{DeleteFile

This command lets you delete files.

Example: {{DeleteFile C:\Data\ReadMe.txt. No error is shown, if the file does not exist.

Always a file path is needed. Wildcards are possible. Example: {{DeleteFile C:\Data\*.txt) deletes all files with the extension .txt

 

1.10.1.58     {{FileAttrib

This command allows changing the file attributes. Syntax: {{FileAttrib Path | Filter | Subdirectories | ReadOnly | Hidden | Archive. Example: : {{FileAttrib C:\Temp | *.TXT | {{True} | +R | -H | +A. All files in directory C:\Temp and in all subdirectories with extension .TXT will be set to ReadOnly, Not Hidden, and Archive. Other example: {{FileAttrib C:\Temp | John.txt | {{False} | -R. Only in directory C:\Temp (and not in the subdirectories) in the file John.txt the ReadOnly flag will be removed.

Hints. The three parameters: | +R | -H | +A can be exchanged. A + means setting the flag, a – means removing the flag. The last two parameters can be omitted (they are optionally).

Warning: Be careful by using this command. If e.g. all files in drive C:\ are set to ReadOnly most programs will not work any longer correctly.

 

1.10.1.59     {{Goto

If the 'Mouse and Key Recorder' comes across a {{Goto MyLabel it jumps to the {{Label MyLabel. The {{Goto function can be used for the proper reaction of different situations during macro run. Example: {{If {{Var1} = 15 ;{{GoTo CONTINUE; If variable 1 contains the value15 then the Recorder jumps to {{Label CONTINUE. {{Goto allows jumping forward and backward in a macro.

 

1.10.1.60     {{Gosub, {{Return}

Gosub lets you use subroutines. Subroutines are macro-parts which needs to be used often. Example: You want to calculate the numbers of a table with a special formula. The macro-part which calculates the formula is moved to a subroutine. Syntax: {{Gosub Label. When the Recorder reaches the command {{Gosub it jumps to the Label-line. There the commands after Label are processed, until the Recorder reaches the command {{Return. The command {{Return causes a jump back to the line after {{Gosub.

Example:

{{Gosub MySubProgr

.....

{{Goto MyEnd

{{Label MySubProgr

.....

{{Return}

.....

{{Label MyEnd

 

Hints:

 

1.10.1.61     {{Label

Labels are needed for the commands {{Goto and {{Gosub. They are the targets for these jumps. Example: {{Label MyLabel. Please notice, that no colon (:) is necessary after the label. Labels are case sensitive. That means myLabel is not the same as MyLabel.

 

1.10.1.62     {{LoadMacro

This command loads another macro and starts it immediately. Example {{LoadMacro C:\Data\Recorder\MyMacro.krc. If there are commands after the {{LoadMacro command, these commands are not carried out! This function allows breaking down a large macro in smaller parts. Smaller parts can be maintained more easily.

Hint: The command {{Master} allows to call all your parts from one master macro.

 

1.10.1.63     {{Master}

The {{Master} command allows to load and run several macros in succession. Example:

{{Master}

{{LoadMacro C:\MyMacros\Macro1.krc

{{LoadMacro C:\MyMacros\Macro2.krc

Result: Macro1 is loaded and started. When Macro1 has finished macro2 is loaded and started. Nearly all valid commands, not just {{LoadMacro are possible after {{Master.

Restrictions: After a {{Master no {{GoTo is possible in the macro containing the {{Master} command. Also {{GoSub, {{ImportFile, {{ImportNextLine and {{DoImport are not possible in this case.

A {{Master macro must not call (by {{LoadMacro) a second macro, which itself contains a {{Master command.

Loops are possible in a macro containing the {{Master command. But some restrictions have to be kept in mind:

Important: Normal variables must not be used in a macro containing a {{Master command and a {{LoadMacro. You need to use {{GlobVar, {{GlobString, {{GlobAsk in this case.

 

1.10.1.64     {{WriteToFile, {{WriteLineToFile

Allows you to write text to a file. Example: {{WriteToFile C:\MyFile |MyText. {{WriteToFile writes to one line (without carriage return), {{WriteLineToFile adds a carriage return after the text end. These two commands can be used to write comments to a file (Macro logging).

 

1.10.1.65     {{Minimize}, {{Normalize}

These two commands allow to minimize the 'Mouse and Key Recorder' to the taskbar or to bring it back to the normal size.

See also chapter 'Command Line Functions' for a minimized start of the Mouse and Key Recorder. (MKRMinimize)

Important: Do not show {{Stop or {{MessageBox2 while minimized !!! On certain operations systems you can NOT close these windows any more.

 

1.10.1.66     {{SetIndex1}, {{Index1}

This command gives you the opportunity to use an ‘indirect addressing’ for your variables. Example:

{{SetIndex1} 55

{{Var{{Index1}}

The Recorder replaces {{Index1} during the macro run with it’s content. Result: {{Var55}. In other words: In this example {{Var{{Index1}} will send the content of {{Var55} to the active application.

You can use 10 different indexes ({{Index0}..{{Index9}. The command {{Index can be used at any place where a variable number is necessary. (Var, Globvar, SetVar, String, SetString, Ask, WriteAsk...).

The {{Index-values are not stored to a file. That means you loose them as soon as the macro ends.

Hint: The command {{Index is a legacy command. The actual 'Mouse and Key Recorder' version can use any variable for an indirection. Example:

{{SetVar1} 55

{{SetVar55} 33

{{Var{{Var1}}

 

1.10.1.67     {{NumLockOn}, {{NumLockOff}

Switching on or off NumLock

Hint: Switching on or off NumLock needs some time. Add a {{Delay if you want to switch on and off NumLock shortly after each other.

 

1.10.1.68     {{SetGenDelay

{{SetGenDelay overwrites the General Line Delay set in the 'Mouse and Key Recorder' window. This command is especially handy for debugging. It lets you 'slow down' parts of the macro.

 

1.10.1.69     {{WaitForIEReady

WaitForIEReady allows waiting for an Internet page to be fully downloaded. Example:

{{If {{WaitForIEReady 10} = {{True} ;{{Goto OK;{{Goto error. If the page download needs more than 10 seconds, the macro jumps to the label error, otherwise to the Label OK. If no Internet Explorer is open, a False is returned. {{ShowError} can be used in the True-action or False-action part. {{ShowError} causes the macro to show an error and to end.

Additional Information: This command can only be used for Microsoft Internet Explorer V4.0 or higher. The Command does not work with Netscape or other browsers.

Recognizing the end of an Internet page download is tricky. Especially if frames are used in the page, the WebBrowser Object delivers a signal for every frame. Sometimes the ready signal appears for a short time between the individual frames. To overcome these problems the WaitForIEReady command checks the ready signal 8 times (with a delay of 0,15 sec between each try.) If these 8 loops are too less (or too high) the number of loops can be set.

Example: {{If {{WaitForIEReady 10,30} = {{True} ;{{Goto OK; {{ShowError}. In this example 30 loops are used. This needs 4,5 sec time.

Hints: If several Internet Explorer are active, then {{WaitForIEReady waits until all Explorers are ready.

If you use the Firefox browser, you can test the stop button (white cross in red button) by using {{GetPixel or {{FindPattern. The stop button changes its color only if all parts of the page are loaded. With Windows 8.1 the function {{WaitForIEReady has become unreliable. If {{WaitForIEReady does not work reliable you can also use the above mentioned Firefox workaround.  See also chapter 'Macro Examples'

 

1.10.1.70     {{SetIEFocus

{{SetIEFocus sets the focus to the first element in the Internet Explorer. This is done by applying an ALT n (%n) to the Internet Explorer. This is a legacy command. You can also use just %n.

Remark: Unfortunately this does not work with all IE versions and Internet pages. In these cases a mouse click to an "empty" location of the browser screen is necessary.  (Switching on and off Favorites in IE: CTRL Shift i). For additional shortcuts search Google with "IE Shortcuts"

 

1.10.1.71     {{WaitForScreenChange

WaitForScreenChange waits for a change on the screen. Syntax: {{If {{WaitForScreenChange Timeout, Pixel-rectangle, Repetitions}

Example:

{{RelativeMouse Corel PHOTO-PAINT, 1, 1, 688, 434, 1.  First the cursor must be located at the place where the screen change will happen. (1 means just locate mouse, do not click)

{{If {{WaitForScreenChange 30,15,1} = {{True} ;{{Goto OK;{{Goto error. If the rectangle behind the cursor (15x15 pixels) does not change 1 time within 30 sec the macro jumps to the label 'error', else to the label 'OK'. You can also use {{ShowError} for the action-part. Then an error text is shown and the macro ends.

If the Repetitions are set to five {{WaitForScreenChange 30,15,5} then a change must stay for 5 x 150 ms before this change will be accepted. The rectangle behind the cursor is calculated from the tip of the arrow. Example for a 15 x15 pixel rectangle: .

Important: Changes of the cursor itself will not be detected. (Just the pixels behind the cursor are monitored.) That means if the cursor changes from arrow to sandglass {{Wait ForScreenChange will not sense this !

{{WaitForScreenChange is just meant for small rectangles (2..100 pixel). If you use a value >100 you get a warning.  Values >100 need an awful amount of time to process (minutes or even hours for larger values)

Hint{{Wait ForScreenChange does not work with all graphic cards.

{{PrepareScreenChange}

Sometimes an action needs just a short time and when {{WaitForScreenChange becomes active the change on the screen is already gone. To avoid this you can use {{PrepareScreenChange. Example:

{{Mouse  1, 1, 871, 854, 1   {{' Locate the cursor

{{PrepareScreenChange}     {{' The square (15x15 pixel) behind the cursor is saved

{ENTER}         {{' In this example enter will cause the screen to change behind the cursor

{{If {{WaitForScreenChange 30,15,1} = {{True};;{{ShowError}

The {{WaitForScreenChange now uses the square saved before the {ENTER} command. That means even if the screen changes immediately after enter, the change will be sensed. If {{PrepareScreenChange is used, the Pixel-Rectangle is always 15x15 even though you specify something else in the following {{WaitForScreenChange 30,99,1}. The rectangle saved by {{PrepareScreenChange can only be used once by {{WaitForScreenChange. {{WaitForScreenChange clears the rectangle and the next {{WaitForScreenChange will work normal.

 

1.10.1.72     {{GetPixel

{{GetPixel reads the color of a pixel on the screen. Syntax: {{GetPixel X-Coordinate, Y-Coordinate. Example: {{GetPixel 150, 288. If you want to get the pixel color beyond the cursor arrow you can use: {{GetPixel –1, -1. GetPixel allows you to wait for a certain color of a pixel. Example: {{If {{GetPixel 100, 200} = 13160660;{{Goto DoItAgain;

For checking the color you need to retrieve the color number. This can be done by:

{{SetClipBoard {{GetPixel 150, 288}. Let this command run. Afterwards you can paste the number into the macro. If the RGB format is known, the command {{RGB can be used. Example: {{If {{GetPixel 100, 200} = {{RGB 100,200,300} ;{{Goto DoItAgain;

Technical hint: {{GetPixel returns the following values: 0x00bbggrr (b = blue, g = green, r = red, Hexadecimal). For converting the number the command {{RGB can be used. In the Internet lots of tools can be found to convert those numbers. (Take care, the sequence of the colors is not always the same in these tools)

Hint: {{Mouse  1, 1, 430, 283, 1 and {{Mouse  1, 1, 430, 283, 0 place the curser not always on the same location. Difference: sometimes 1 pixel. Reason: The two commands have to use different coordinate systems. This leads to rounding errors.

 

1.10.1.73     {{RGB

{{RGB converts color-information from RGB to the common format used by {{GetPixel. Example: {{RGB 128,100,255}. RGB stands for Red, Green, Blue. The individual colors can have a value between 0 and 255. This command can only be used as parameters. That means it must not start at the beginning of a line. Example for a parameter use: {{MessageBox {{RGB 128,100,255}.

Hint: Some other converting programs use BGR instead of RGB. If you have problems exchange the colors.

 

1.10.1.74     {{FindPattern

{{FindPattern finds certain patterns on the screen, even if they do not always appear at the same location. Here an example:

 

 

 

We want to enter ID and Password. But these fields can move. Possible reasons:

 

{{FindPattern is like an artificial eye, which searches in a defined area for a certain pattern. In this example we will search e.g. for the text 'eBay User ID' and locate the cursor into the entry field.

Procedure:

 

Click menu Insert and then 'Find Pattern'

 

The following form appears:

 

 

It is possible to use several patterns in one macro (max. 200). The first line defines the number of the pattern. The second and third lines define the search area. {{FindPattern does not search the whole screen (this would need too much time) but just a defined search area. Depending of the expected movement of the searched pattern the search area can be set smaller or larger. The above 'Find Pattern' window has a size of 600 to 200 pixels.

The searched pattern is always a square. Small search pattern are found faster, but the danger of finding a wrong one is larger. The ideal size is about 10 to 20 pixel.

Example 15 Pixel:    Example 30 Pixel:

 

If the pattern location is not the same as the target click location, a cursor offset can be used.

After clicking OK the curser must be put the target (pattern) location within 5 seconds. (Just place the cursor, no click is necessary). After 5 seconds a square appears for a short period, and then the Offset is questioned:

 

 

In the above 30 pixel-example we would locate the cursor in the entry field.

 

Windows 7 often uses changing background colors when the mouse is hovering over an icon.

Example:

 

By using the option 'Two-step cursor' a pattern can be recorded without the background color.

This option adds a delay. During this delay-time the cursor can be moved away from the icon.

 

 

After OK the following code will be entered into the Recorder window:

{{If {{FindPattern 1, 626, 489, 600, 200, 0} = {{True};;{{ShowError}

{{IncVarFindPatternCoord_X_1} 60

{{IncVarFindPatternCoord_Y_1} 25

{{Mouse  1, 1, {{VarFindPatternCoord_X_1}, {{VarFindPatternCoord_Y_1}, 0

 

When you run this macro the following happens:

 

Sometimes several identical patterns need to be found. Example: A list with bullets. To find identical patterns the option: ‘Find multiple patterns’ can be set (after: Insert/FindPattern). {{FindPatterns finds then all fitting patterns within the search area. The found coordinates are numbered:

{{VarFindPatternCoord1_X_1}, {{VarFindPatternCoord1_Y_1}

{{VarFindPatternCoord2_X_1}, {{VarFindPatternCoord2_Y_1}

The amount of found patterns is saved in variable: {{VarFindPattern_Numbers}

The {{FindPattern comand can find maximum 200 identical patterns. A command for finding multiple patterns looks like: {{FindPattern 1, 626, 489, 200, 200, 2}

Important: Just patterns which are not exactly horizontally grouped are found. (Vertically or diagonal is ok.)

 

Hints:

The search speed depends on four factors: PC performance, size of the search area, size of the pattern and appearance of the pattern. The pattern appearance influences the search speed, because at each pixel in the search area, first the four corner pixel and the center pixel of the pattern square are tested. Is one of these pixels are different to the background the pattern comparison is ended and the next search area pixel is tested. Otherwise the Recorder starts to test the whole pattern square. Our example (30 pixel) is not optimal. The four corners are white like the most of the search area. Maybe the center pixel will help…

The coordinates in the {{FindPattern command can be replaced by a -1. In this case the actual mouse coordinates are used. Example: {{If {{FindPattern 1, -1, -1, 600, 200, 0}…

To check the size of the search area a trick can be used. By changing the last number to 1: {{If {{FindPattern 1, 626, 489, 200, 200, 1} = {{True};;{{ShowError}. the search area is marked with two blue lines. (This view-mode causes an error, means for the real work of the macro, this number needs to be set back to zero.)
If the search area is small, the blue lines can be seen just a very short time. By using a 3 as last number, the search area is filled by the blue color. This blue square stays until the PC overwrites it. Example: {{FindPattern 1, 626, 489, 20, 20, 3}. Also by using parameter 3 {{FindPattern always shows an error. Therefore it needs to be set back to zero for normal macro run.

Important:
If the search area exceeds the screen border, then the search area is moved inside the screen and the cursor position is moved to the center of the resulting search area. If the pattern is not found, please check the search area by the trick described above. …00, 200, 1} Hint: The command {{ScreenSize shows you the size of the primary screen and the center of it.
By using Option 10 the whole screen can be searched independently of the search area defined in the command. Example: {{If {{FindPattern 1, 0, 0, 0, 0, 10}. The search starts in the center of the screen. Option 10 can be combined with options 1, 2 and 4. This can be done by using options 11, 12 und 14. Example: 11 covers option 1 and 10.

The patterns are saved as files. The files get the same name as the macro with an addition. Example for pattern 1: MyMacro.krc results in: MyMacro_FP_1.fpd. That means, if a macro contains {{FindPattern and needs to be renamed, also the pattern files must be renamed.

If patterns on the screen (like buttons or text fields) change every time they appear (this happens sometimes in Internet pages) then {{FindPattern can then not find these parts. In this case it makes sense to search for a constant text or picture and then by using cursor offset clicking the button or text field.
Another possibility is using Option 4. {{FindPattern 1, 626, 489, 200, 200, 4} With this Option, just four pixel are checked (the four pixel in the corners). With some luck the changed pixels are not at these four locations.

Important: The pattern you search for must exist on the screen, when the search begins. {{FindPattern starts the search at the in the command defined position and moves outwards. If the pattern appears a little bit too late {{FindPattern can not recognize it.

{{FindPattern works just on the primary screen. That means if more than one monitor is used {{FindPattern can not find any pattern on the additional screens.

The variable name: FindPatternCoord_X/Y_1, 2.. is reserved for {{FindPattern and should not be used for other purposes.

{{Mouse  1, 1, 430, 283, 1 and {{Mouse  1, 1, 430, 283, 0 place the curser not always on the same location. Difference: sometimes1 pixel. Reason: The two commands have to use different coordinate systems. This leads to rounding errors.

With Windows Aero (Vista/Win7) the old version of {{FindPattern does not work well (command needs a terribly long time). In this case you can use {{WindowsAeroOff} to switch off Windows Aero.

 

{{ShowPattern: When you are using lots of patterns it becomes difficult to keep the overview. (Which number contains which pattern). In this situation the command {{ShowPattern 5 helps. After this command appeared in the macro, a pattern overview is shown left or right of the search area, each time a {{FindPattern command is carried out. The actual searched pattern is marked with two blue lines. The number after {{ShowPattern 5 defines how long the pattern overview is shown (here 5 seconds). All patterns are shown in sequence. Example: ..FP_1.fpd, ..FP_3.fpd, ..FP_4.fpd. (No gap for the missing ..FP_2.fpd).

 

1.10.1.75     {{CheckWindow

This command lets you check the existence of an application window. Example {{CheckWindow Microsoft Word. If the window exists the Recorder switches to this window and writes a one, if the window does not exist the Recorder writes a zero. The window name is the same you find when you press ALT TAB. You can use only a part of the name, but that part must be unique and a whole word. Example: Alt Tab Text: Recorder2000.doc - Microsoft Word. Switch command: {{Switch Microsoft Word. Sometimes also the dash (- Microsoft Word) is needed. You might need to experiment what Windows accepts.

Normally {{CheckWindow is used together with a {{If command. Example:

{{if {{CheckWindow Microsoft Word} = {{True} ;{{Goto Exist;{{Goto NotExist

See also {{Switch for additional options. (Switching technique and =>, <=)

Important: If you want to use {{CheckWindow in a {{If command and if you want to use <= or => in your window title you must use string variables. Example:

{{SetStringTitle Open Report=>

{{If {{CheckWindow {{StringTitle} = {{True} ;{{Goto ReportOk;{{Goto ReportNotOk           

 

 

1.10.1.76     {{GetWindowPos

{{GetWindowPos reads the position of a window. Syntax: {{GetWindowPos WindowName. Example: {{GetWindowPos Microsoft Word. The coordinates of the window are written to variables. The following variable names are used:

{{VarGetWinCoord_X, {{VarGetWinCoord_Y   (Coordinates top left)

{{VarGetWinCoord_X_End, {{VarGetWinCoord_Y_End  (Coordinates bottom right)

Hint: The command {{GetWindowPos automatically switches to the WindowName.

Important: The command {{GetWindowPos cannot be used as parameter. That means {{GetWindowPos must be located at the begin of the line.

 

1.10.1.77     {{GetCursorPos

{{GetCursorPos reads the position of the cursor. Syntax: {{GetCursorPos. The coordinates of the window are written to variables. The following variable names are used:

{{VarGetCursorCoord_X, {{VarGetCursorCoord_Y.

Important: The command {{GetCursorPos cannot be used as parameter. That means {{GetCursorPos must be located at the begin of the line.

 

1.10.1.78     {{Decode

The Recorder is quite handy for entering name and passwords. Certain programs in the office need a login every time you start it, even though you have logged in to the PC already. If you write the passwords in plain text into the macro the IT (Information Technology department) could get angry. The command {{Decode can be used for those passwords. For coding the passwords a small tool is necessary. This tool can be ordered free from Kra-Tronic Corp. (For registered users).

Example: {{Decode 212232404250164402210372375201334516206455376504. The encoded text can contain all numbers, characters and special characters.

Important: The command {{Decode cannot be used as parameter. That means {{Decode must be located at the begin of the line.

 

1.10.1.79     {{Sort

The command {{Sort can be used for sorting numbered variables. Syntax: {{Sort VariableType, VariableName, StartNumber, EndNumber, RemoveDoubleEntries. Example: {{Sort VAR, John, 1, 20, 1. This command will sort the variables {{VarJohn1 … {{VarJohn20 and will remove double entries. VariableType: VAR and STRING are possible. RemoveDoubleEntries: 0 = Do not remove, 1 = remove double entries. If entries have been removed then in a VAR variable the surplus entries contain a 0, in a STRING variable the surplus entries are empty (#emptyX5#).

 

1.10.1.80     More commands

More commands (especially useful for software testing) can be found in chapter: 'Special Functionality: Automated Software Test'. Commands: {{CheckFocus, {{WaitForFocus, {{WaitForEndFocus, {{MessageBox2

 

 

1.10.2     Special Commands

 

The Mouse and Key Recorder contains additional commands, which do often not appear in the command window. These commands are seldom used. Therefore they often must be entered manually.

 

The following commands can be found in the: {{Switch description:

{{KeepSpace, {{UseOldSwitch}, {{UseNewSwitch}, {{UseForeground}, {{UseRecorder}

The following commands can be found in the: {{Start description:

{{StartAndWait

The following command can be found in the: {{WaitForScreenChange description:

{{PrepareScreenChange

 

 

1.10.2.1     {{CTRL, {{Shift, {{Alt

{{CTRL, {{Shift, {{Alt allow to press these keys separately (without a combination with other keys). The three commands can be combined freely on one line. e.g. only one command or all three.

Examples:

{{CTRL. The key CTRL is pressed for 50 ms (milliseconds). 50 ms is the default if no duration is defined.

{{Alt 700. The key Alt is pressed for 700 ms (0,7 seconds)

{{Shift 300 {{CTRL {{Alt. The three keys are pressed for 300 ms.

Hint: Just the time belonging to the first command is used for all keys. {{Shift 300 {{CTRL 600 means that Shift and CTRL are pressed for 300 ms.

 

1.10.2.2     {{CTRL+/-, {{Shift+/-, {{Alt+/-

{{CTRL+/-, {{Shift+/-, {{Alt+/- allow to switch on and off these keys.

Examples:

{{CTRL+ switches on the CTRL key. The CTRL key stays on until a {{CTRL or a {{CTRL- command is used.

{{CTRL+ {{ALT+ switches on the CTRL  and ALT key. The keys stays on until {{CTRL {{ALT or {{CTRL- {{ALT- command is used.

Important: If {{CTRL+, {{Shift+, {{Alt+ have been used in the macro, they MUST be switched off before the macro ends! Otherwise the keyboard acts very strange.

 

1.10.2.3     {{Space

This command allows to press SPACE for a defined time. Examples: {{SPACE. The key SPACE is pressed for 50 ms (milliseconds). {{Space 700. The key SPACE is pressed for 700 ms (0,7 seconds). Hints: This command can just be used for pressing the SPACE key and not within {{If or {{SetString. For those cases you have to use #SpaceX5#."

{{Space does not generate keystroke repeats like you get when you keep down the space key manually. {{Space is mainly needed for automating games.

 

1.10.2.4     {{CR}, {{LF}, {{Tab}

These three commands let you add control characters to your text. CR = Carriage Return, LF = Line Feed, Tab = Tabulator.

These commands can only be used as parameters. That means they must not start at the beginning of a line. Example for a parameter use: {{MessageBox {{First Line{{CR}Second Line} or First Part{{Tab}Second Part. Instead of {{Tab} also {TAB} can be used. {TAB} may also be located at the beginning of a line.

 

1.10.2.5     {{MouseDownTime

For games sometimes the mouse button must be pressed for a certain time. The command {{MouseDownTime allows to set this time. Example: {{MouseDownTime 3000. Every mouse-click keeps down the mouse button for 3 seconds. {{MouseDownTime 0 sets back the click to the default time.

 

1.10.2.6     {{KeyDownTime

For games sometimes a key must be pressed for a certain time. The command {{KeyDownTime allows to set this time. Example: {{KeyDownTime 3000. Every keyboard-click keeps down the key button for 3 seconds. {{KeyDownTime 0 sets back the click to the default time.

IMPORTANT: This command works just together with {{SendTextSpecial}!

 

1.10.2.7     {{MacroPath}

This command delivers the path of the loaded macro. Example: Macro: C:\My Data\Recorder\MyMakro.krc. {{MacroPath delivers: C:\My Data\Recorder\.

 

1.10.2.8     {{AppDataPath}

This constant delivers the path to the directory where the following files are located: Debug-Log-File, global variables, hotkey file, temporary macros… This command can only be used as parameter. That means it must not start at the beginning of a line. Example for a parameter use: {{MessageBox {{AppDataPath}.

 

1.10.2.9     {{AppPath}

This constant delivers the path to the directory where the recorder application is located. (Recorder.exe) This command can only be used as parameter. That means it must not start at the beginning of a line. Example for a parameter use: {{MessageBox {{AppPath}

 

1.10.2.10     {{FileSize

This command delivers the size of a file in Byte. If a file is not found this command delivers a size of -1. This command can only be used as parameter. That means it must not start at the beginning of a line. Example for a parameter use: {{MessageBox {{FileSize C:\MyFile.txt}

Hint: This command cannot be found in the window: "Insert command". (It needs to be entered manually.)

 

1.10.2.11     {{WindowsKey

This command is entered if you press the windows key.The command {{WindowsKey} allows a parameter like R or E. Example: {{WindowsKey R. This command opens the Windows Run command. {{WindowsKey E opens the Explorer. {{WindowsKey M minimizes all windows and +{{WindowsKey M brings the windows back. {{WindowsKey L logs out the actual user. Hint: The parameters are not recorded automatically. You need to add them manually in the editor.

 

1.10.2.12     {{NoFocus}

When a macro ends the Mouse and Key Recorder gets the focus. (Recorder is in the foreground) Normally this is a desired reaction. But in certain situations, it would be better the focus stays on the processed application. To avoid the focus change to the Recorder, the command {{NoFocus} can be used.

If a macro contains {{NoFocus}, the Mouse and Key Recorder will NOT get the focus when the macro ends. (Exception: If the Recorder had the focus already during macro run, then it will keep the focus)

Hint: {{NoFocus should be located at the end of the macro. Reason: Otherwise when the Recorder is minimized and an error appears, the Recorder can not any longer be normalized.

 

1.10.2.13     {{GetWindowName}

This command returns the name of the active window (The one which is on the top. You can recognize it by the colored heading bar). The same time focus is given to this window. This command can only be used as parameters. That means it must not start at the beginning of a line. Example for a parameter use: {{MessageBox {{GetWindowName}.

 

1.10.2.14     {{CapsLockOn}, {{CapsLockOff}

These commands allow switching on or off CapsLock. (This is the key, which causes to write all letters upper chase). If {{CapsLockOff} is set at the begin of a macro, the macro runs properly even in cases when the user forgot to reset CapsLock. Hint: The original state of CapsLock is not restored after the macro ends.

 

1.10.2.15     {{DebugOn}, {{DebugOff}

The command {{DebugOn} shows a debug window. Each time a variable is read or written, the name, the value und the accompanied command are written into the debug window. The newest entries are placed at the top of the window; the older entries are moved downwards. {{DebugOff} ends the variable reporting, but lets the debug window open.

Restriction: The debug window might not appear if the Recorder-macro is called by another application e.g. from an Excel macro. The debug window can also not bee seen in case the Recorder has full screen size.

 

1.10.2.16     {{ResetLogFile}

During large macros (or during macros with lots of loops) the Debug-Log-file can get quite large. This can slow down the macro run (or even causing errors in the macro run). By using the command {{ResetLogFile}  the Log-file can be copied and deleted. Maximum five Debug-Log-files are kept. {{ResetLogFile} does the following: Debug-Log-file 4 is copied to Debug-Log-file 5, File 3 is copied to File 4, File 2 is copied to File 3, and the original Debug-Log-file is copied to Debug-Log-file 2. The original Debug-Log-file is then deleted and a new Log file is created. The original Debug-Log-file and Debug-Log-file 2 can be accessed by menu: Tools / Options / Replay / 'Open Log File'. For opening the remaining files the following command can be used: {{Start notepad {{AppDataPath}\Logfile3.txt

 

1.10.2.17     {{BracesReplace

Braces ( {} ) in variables: Because the Recorder uses braces as starting- and end-sequence of commands, using braces in variables can cause problems. Braces can be part of texts if e.g. Internet pages are copied to variables.

Solution: By using the following macro code, the braces can be exchanged to other characters and finally back to the original braces:

^c

{{BracesReplace § | ° | {{True}

^v

The first parameter (here §) defines the replacement for {, the second parameter (here °) defines the replacement for }, the third parameter (here {{True} defines Replacement or Reverse-Replacement ( {{True} => {} are replaced, {{False} => {} are restored).

Additional function of BracesReplace: The characters: +,^,%,~,(,),[,],{,} are not printed out by the Recorder (These are command characters). The following command allows giving out also such characters: {{BracesReplace  x | x | 2. This command replaces the command characters in the clipboard by {+},{^},{%},{~},{(},{)},{[},{]},{{},{}}. That way they are printable.

BracesReplace always works on the clipboard. Remark: the replacements can also be texts like #MyStartingChar#

Hint: Earlier versions of the Recorder offered the solution: ReplaceBraces.exe. This solution is not any longer supported. Please change theses commands if you have used them.

 

1.10.2.18     {{HDFreeSpace

The command {{HDFreeSpace shows the free space on a hard disk (in Megabyte). Example: {{MessageBox {{HDFreeSpace C:}  Important: This command can only be used as parameter. That means it must not start at the beginning of a line. Example for a parameter use: {{SetVarFreeSpace {{HDFreeSpace C:}

 

1.10.2.19     {{HDUsedSpace

The command {{HDUsedSpace shows the used space on a hard disk (in Megabyte). Example: {{MessageBox {{HDUsedSpace C:}  Important: This command can only be used as parameter. That means it must not start at the beginning of a line. Example for a parameter use: {{SetVarUsedSpace {{HDUsedSpace C:}

 

1.10.2.20     {{GetOSVersion}

This command returns the operating system version. Example: "Microsoft Windows NT 6.1.7601 Service Pack 1". This command can only be used as parameters. That means it must not start at the beginning of a line. Example for a parameter use: {{MessageBox {{GetOSVersion}

 

1.10.2.21     {{SendEMail}

By using the command {{SendEMail, E-Mails can be sent out directly from the Recorder (without the need of a mail client like Outlook)

Example:

{{SetStringtxtEMailServerX5 smtp.gmail.com

{{SetStringEMailAccountX5 MyEMailAccountUserName

{{SetStringtxtEMailPWX5 My-Account-Password

{{SetStringtxtEMailPortX5 587

{{SetStringtxtEMailSSLX5 YES

{{SetStringtxtEMailDomainX5 #emptyX5#

{{SetStringtxtEMailSenderX5 MySenderName@gmail.com

{{SetStringEMailAddrX5 addressee.name@addresseeDomain.com

{{SetStringtxtEMailSubjectX5 E-Mail Subject

{{SetStringEMailTextX5 Mein E-Mail Text

{{SendEMail

{{If {{VarEMailErrorStatusX5} = {{True} ;{{MessageBox {{StringEMailErrorTextX5};

 

The following information must be provided to be able to send an Email successfully:

 

StringtxtEMailServerX5: The used Mail Server. e.g. smtp.gmail.com

StringEMailAccountX5: The account at e.g. gmail. (Often the own e-mail address)

StringtxtEMailPWX5: The password belonging to the account

StringtxtEMailPortX5: The port belonging to the account. (See later on)

StringtxtEMailSSLX5: Encrypted Mail transport YES or NO

StringtxtEMailDomainX5: Domain Name (Most of the time not necessary, then use:  #emptyX5#

StringtxtEMailSenderX5: Sender E-Mail address

StringEMailAddrX5: addressee E-Mail address

StringtxtEMailSubjectX5: E-Mail Subject (E-Mail title)

StringEMailTextX5: E-Mail Body

 

The following two variables show whether an e-mail has been sent successfully:

{{VarEMailErrorStatusX5}: {{True} = Error appeared. {{False}: No error

{{StringEMailErrorTextX5}: If an error appeared this variable contains the error text.

 

Finding the correct parameters is sometimes not so easy. You might find them in the internet or you might need to ask your provider.

There are two kinds of ports: Encrypted e.g. 465, 587... and not encrypted: e.g. 25

 

Here two working examples

GMail:

{{SetStringtxtEMailServerX5 smtp.gmail.com

{{SetStringtxtEMailPortX5 587

{{SetStringtxtEMailSSLX5 YES

{{SetStringtxtEMailDomainX5 #emptyX5#

 

HostFactory:

{{SetStringtxtEMailServerX5 mail.myDomain.com

{{SetStringtxtEMailPortX5 25

{{SetStringtxtEMailSSLX5 NO

{{SetStringtxtEMailDomainX5 #emptyX5#

 

Important: Parameters need to be provided correctly e.g "smtp.gmail.com " will not work (because of the surplus space).

Hints: It is also possible to send SMS by using {{SendEMail}. This is possible by using a e-mail to SMS gateway. There are several companies in the Internet offering such a service. e.g. http://www.ecall.ch/

(#emptyX5# is case sensitive)

 

 

1.10.2.22     Mathematical and string commands

The following commands are special commands for treating numbers and strings. They can only be used as parameters. That means they must not start at the beginning of a line. Example for a parameter use: {{MessageBox {{String1}.

The Mathematical and string commands use a | as separator. If you want to use another separator it can be changed by command {{MathStrSeparator. Example: {{MathStrSeparator *

Not all errors generate an error message. If a mathematical error like an overflow a division by zero appears, a zero is returned.

The Mathematical and string commands can not process calculations within the commands. Example: (WRONG) {{MessageBox {{Left Recorder | {{VarLimit} + 5}. Calculations must be made beforehand. {{IncVarLimit 5}    {{MessageBox {{Left Recorder | {{VarLimit}}.

Exception: The above limitations are not valid for the command {{Calc.

Hint: Using braces in variables can cause problems. Reason:  {} are used as starting- and end-sequence in commands. Solution: You can use "BracesReplace" for circling around this problem. See chapter: Hints / Limitations.

 

 

1.10.2.23     {{Power

This command raises a number to the power of an exponent. Example: 52: {{MessageBox {{Power 5 | 2}. Result 25. Important: Number can be negative only if exponent is an integer value. See also the hints in chapter: Mathematical and string commands.

 

1.10.2.24     {{Mod

This command divides two numbers and returns only the remainder. Example: {{MessageBox {{Mod 14 | 5}. Result 4. Hint: The mod command divides number1 by number2 (rounding floating-point numbers to integers) and returns only the remainder as result. For example, in the following command, {{MessageBox {{Mod 19 | 6.7} results in 5. Maximal number for {{Mod: 264/2.

See also the hints in chapter: Mathematical and string commands.

 

1.10.2.25     {{Div

This command divides two numbers and returns an integer result. Example: {{MessageBox {{Div 14 | 5}. Result 2. Hint: Before division is performed, the numbers are rounded. Maximal number for {{Div: 264/2.

See also the hints in chapter: Mathematical and string commands.

 

1.10.2.26     {{IsNumeric

This command checks if a value is a valid number. Example: {{If {{IsNumeric 23f3} = {{True} ;{{Beep};

Result: No beep will be heard. (23e3 would produce a beep).

See also the hints in chapter: Mathematical and string commands.

 

 

1.10.2.27     {{Len

This command returns the number of characters in a string. Example: {{MessageBox {{Len {{String1}. Leading and tailing spaces are not considered.

See also the hints in chapter: Mathematical and string commands.

 

1.10.2.28     {{InStr

This command Returns the position of the first occurrence of one string within another. Syntax: {{InStr StartNumber | String being searched | String sought. Example: {{MessageBox {{InStr 1 | Recorder | der} Result: 6. If nothing is found a zero is given back.

See also the hints in chapter: Mathematical and string commands.

 

1.10.2.29     {{Mid

This command returns a string containing a specified number of characters from a string. Syntax: {{Mid String | StartNumber | Length. Example: {{MessageBox {{Mid Recorder| 3 | 5} Result: corde. For the patameter Length can also -1 be used. Then the whole text from StartNumber until the end of the text is returned. Example: {{MessageBox {{Mid Recorder| 3 | -1} Resultat: corder.

See also the hints in chapter: Mathematical and string commands.

 

1.10.2.30     {{Left

This command returns a string containing a specified number of characters from the left side of a string. Syntax: {{Left String | NumberOfCharacter. Example: {{MessageBox {{Left Recorder | 3} Result: Rec.

See also the hints in chapter: Mathematical and string commands.

 

1.10.2.31     {{Right

This command returns a string containing a specified number of characters from the right side of a string. Syntax: {{Right String | NumberOfCharacter. Example: {{MessageBox {{Right Recorder | 6} Result: corder

See also the hints in chapter: Mathematical and string commands.

 

1.10.2.32     {{Trim

This command returns a string containing a copy of a specified string without leading and trailing spaces. Example: {{MessageBox {{Trim     Text with spaces    }. Result: Text with spaces. This command is only seldom necessary, because lots of Recorder commands carry out a trim automatically.

See also the hints in chapter: Mathematical and string commands.

 

1.10.2.33     {{Ucase

This command returns a string containing the specified string, converted to uppercase. Example: {{MessageBox {{UCase Recorder}. Result: RECORDER.

 

1.10.2.34     {{Lcase

This command returns a string containing the specified string, converted to lowercase. Example: {{MessageBox {{LCase Recorder }. Result: recorder.

 

1.10.2.35     {{Chr

This command returns a string containing the character associated with the specified ASCII character code. Example: {{MessageBox {{Chr 33}. Result: !

 

1.10.2.36     {{Asc

This command returns an number representing the character code corresponding to the first letter in a string. Example: {{MessageBox {{Asc Hello}. Result: 72

 

1.10.2.37     {{Replace

Returns a string in which a specified substring has been replaced with another substring a specified number of times. Syntax: {{Replace OriginalText | Text to replace | New text | Starting point in the OriginalText | Number of replacements. Example: {{MessageBox {{Replace Recorder | c | k | 1 | -1}  Result: Rekorder.  -1 means all existing c will be replaced

Hint: It is not possible to replace a character by } with this command. Reason:  } Is used as separator in the command. Solution: You can use "BracesReplace" for this task. See chapter: Hints / Limitations.

 

1.10.2.38     {{Calc

The above mathematical functions are useful but have a big disadvantage. They can not be combined like 5+2)*Sin(1.54). The command {{Calc allows combining operations in one command. Additionally more than 70 mathematical functions are supported. Syntax: {{Calc ListOfOperations. Examples: {{Calc (5+2)/Power(3,2). Result: 0,777. {{Calc uses the common mathematical rules (* before -). Recorder variables can also be used in this command: {{MessageBox {{Calc 5*{{VarMyValue}+(25+{{VarMyValue2})*Power({{VarMyValue3},2)}

 

Here the list of all possible operations:

 

Function

Description

Note

+

addition

 

-

subtraction

 

*

multiplication

 

/

division

35/4 = 8.75

GT(x,y)

x greater than y  (>)

return 1 (true)   0 (false)

GE(x,y)

x equal or greater than y  (>=)

return 1 (true)   0 (false)

LT(x,y)

x less than y  (<)

return 1 (true)   0 (false)

LE(x,y)

x equal or less than y  (<=)

return 1 (true)   0 (false)

EQ(x,y)

x equal y  (=)

return 1 (true)   0 (false)

NE(x,y)

x not equal y  (<>)

return 1 (true)   0 (false)

Percent(x,y)

inverse tangent

Percent(50,10) = 5  (5% from 50)

Div(x,y)

cosine

Div(35,4) = 8

mod(a,b)

Division remainder (Divisions-Rest)

mod(29,6) = 5    mod(-29 ,6) = -5

Power(n,x)

exponential

Power(3,1.8) = 7.22467405584208

Abs(x)

absolute value

Abs(-5) = 5

Fact(x)

factorial

Fact(5) = 120

exp(x)

exponential

dec(-3.8) = -0.8

Int(x)

integer part (ganzzahliger Teil)

int(-3.8) = −4

Ceil(x)

integer part (ganzzahliger Teil)

Ceil(-3.8) = 3

Floor(x)

integer part (ganzzahliger Teil)

Floor(-3.8) = −4

decim(x)

decimal part  (Dezimalteil)

decim(-3.8) = -0.8

Trunc(x)

Part before decimal point

Trunc(-3.8) = -3

round(x,d)

round a number with d decimal places

round(1.35712, 2) = 1.36 

ln(x), log(x)

logarithm natural

argument x>0

logN(x,n)

N-base logarithm

logN(16,2) = 4

Log10(x)

10-base logarithm

Log10(1.2) = 0,699

rnd

Random (Zufallszahl)

returns a random number between x and 0

sgn(x)

Sign  (Vorzeichen)

returns 1 if x >0 , 0 if x=0, -1 if x<0

sqr(x) / sqrt(x)

square root  (Quadratwurzel)

sqr(2) =1.4142135623731,  also 2^(1/2)

cbr(x)

cube root  (Kubik Wurzel)

 "x, example  cbr(2) = 1.2599,  cbr(-2) = -1.2599

root(x,n)

n-th root (the same as x^(1/n)

argument n ¹ 0  ,  x ³ 0 if n even ,  "x  if n odd

min(a,b,)

Minimum (5 parameters necessary)

min(13,24) = 13

max(a,b,)

Maximum (5 parameters necessary)

max(13,24) = 24

mcd(a,b)

maximum common divisor

mcd(4346,174) = 2

mcm(a,b)

minimum common multiple

mcm(1440,378) = 30240

cos(x)

cosine

argument in radiant

sin(x)

sin

argument in radiant

tan(x)

tangent

argument (in radian)  x¹ k*p/2  with k = ± 1, ± 2…

atn(x), atan(x)

inverse tangent

atn(pi/4) = 1

acos(x)

inverse cosine

argument -1 £ x £ 1

asin(x)

Inverse sine

argument -1 £ x £ 1

cosh(x)

hyperbolic cosine

 " x

sinh(x)

hyperbolic sine

 " x

tanh(x)

hyperbolic tangent

 " x

acosh(x)

Inverse hyperbolic cosine

argument x ³ 1

asinh(x)

Inverse hyperbolic sine

 " x

atanh(x)

Inverse hyperbolic tangent

-1 < x < 1

deg(x)

degree sess. conversion

converst sess. degree into current unit of angle

grad(x)

degree cent. conversion

converts cent. degree into current unit of angle

Pi

Constant Pi

3.1415

Land

logic and

Land(a,b) = return 0 (false)

Lor

logic or

Lor(a,b) = return 0 (false)

Lnot

logic not

Lnot(a) = return 0 (false)

Lxor

logic exclusive-or

Lxor(a,b) = return 1 (true)   0 (false)

Lnand

equal

Lnand(a,b) = return 1 (true)   0 (false)

Lnor

logic nor

Lnor(a,b) = return 1 (true)   0 and b=0

Lnxor

logic and

Lnxor(a,b) = return 0 (false)  if a=b

Year(n)

Year (Jahr)

Year(now)

Month(n)

Month (Monat)

Month(now)

Day(n)

Day  (Tag)

Day(now)

Hour(n)

Hour  (Stunde)

Hour(now)

Minute(n)

minute

Minute(now)

Second(n)

second

Second(now)

Weekday(n)

Weekday (Wochentag)

Weekday(now)

Now

system timestamp  (Systemzeit)

 

Today

system datestamp  (Systemdatum)

 

PadLeft(s,l,c)

Padding left side of a text

PadLeft("John",7,"x")= xxxJohn

PadRight(s,l,c)

Padding left side of a text

PadRight("John",7,"x")= Johnxxx

Wcase(s)

First letter uppercase

Wcase("john") = John

Money(x)

Formats number as currency *

Money(12.346) = Fr. 12.35

Format(x)

Format *

format(1234.5,"#,###.00") = 1'234.50

 

 

format(today,"dd. MMM. yyyy" ) = 15. Aug. 2011

 

 

 

 

 

Hints: {{Calc uses for angle expressions the radians calculation. (Pi == 360 degree). If you want to work with sexagesimal degrees, or centesimal degrees you need to convert. Example: {{Calc sin(deg(90)). Result: 1. Centesimal degrees: grad(100)

 

Important: {{Calc treats decimal points a little bit special. The parameters for {{Calc must have a dot as decimal point. Example: {{Calc 1.234 + 2.345}. The result from {{Calc contains the decimal point format defined in the regional settings. Example for Germany: 3,579. For getting always a dot as decimal point for {{Calc outputs the command {{Calc- can be used. Hint: {{Calc- does not allow text outputs like date, time or currency. For changing decimal points, command {{Replace can be used.

For more information for the format command see: *

http://msdn.microsoft.com/en-us/library/0c899ak8.aspx   (Numbers)

http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx   (Dates / Time)

Restriction: Format needs a number in front of the decimal point: Wrong: format(.234,"##.0"), Correct: format(0.234,"##.0"). For getting this zero use a string and add a "0" at the front.

Limits: {{Calc cannot handle more than 100 parameters when parameters all are variables.

 

1.10.3     File Import

 

The three commands: {{ImportFile, {{ImportSeparator and {{DoImport} allow you to use text stored in a file. Example: You want to open 100 files by your graphic application and you want to print them out by night. By using the DOS command dir /b > file.txt you create a file containing all filenames. By using 'loop macro' and {{Start C:\MyGraphicApp {{DoImport} you can open your graphic application with all the 100 files...

Principle: A line in the ImportFile can have several fields separated by the {{ImportSeparator. Every {{DoImport during a macro run reads one of the fields. ({{DoImport 1: First field, {{DoImport 2: Second field, etc.) An ImportFile can have several lines. Every macro loop run processes one line. (Loop 1: Line one, Loop 2: Line two, etc.)

 

Command description

{{1}{{ImportFile C:\MyFileName.Txt. This command defines which import file you want to use. Important: When using Loops, use always an {{1} (or any other number) to ensure that the import file is loaded only once. You can of course use more than one ImportFile.  Example: {{50}{{ImportFile.. After 50 loops another import file is used.

Restriction: Just one import file can be used at the same time. The command {{DoImport} always accesses the file defined with the last executed {{ImportFile.

The import file has the following format:

You can use as many records and as many lines as you want. The command {{ImportSeparator defines what separator is used between the records. (Default: comma).

Example: {{ImportSeparator @}. Hint: At the end of the line you have the option to use or not to use a separator.  Important: You can not use a tabulator character as a separator. Try to use another character or change the character by Microsoft Word's Replace function.

The command {{DoImport} puts the appropriate record to your target application. If you use {{DoImport too often in a line, no error appears, but you get empty strings as a result.
Hints: An empty string ("") can be tested by the constant: #emptyX5#. Example: {{If {{Var1} = #emptyX5#. ;{{Beep;
A single space (" ") can be tested by the constant: #spaceX5#. Example: {{If {{Var1} = #spaceX5#. ;{{Beep;

#emptyX5# and #spaceX5# are case sensitive.

 

How it works:

During loop one, Record_a1 is used when the first {{DoImport} appears. The second {{DoImport} in the same loop uses Record_a2... etc.

During loop two, Record_b1 is used when the first {{DoImport} appears. The second {{DoImport} in the same loop uses Record_b2... etc.

 

Hint: The special characters: (plus sign (+), caret (^), percent sign (%), tilde (~),parentheses ( ) brackets ([ ]) and brace ({})  read by {{DoImport} cannot be given out normally. (Theses characters have special meanings and are not given out directly). Solution: Copy theses texts to the clipbaord ( {{SetClipboard ) and use CTRL v  to give them out. See also chapter: Hints / Limitations: (BracesReplace)

 

Additional command:

In Version 4.3 the command {{ImportNextLine} was added. This command allows you to read the next line in an ImportFile without using Loops. Example:

{{ImportFile c:\MyList.txt

{{Label Start

{{MessageBox {{DoImport}

{{If {{ImportNextLine} = {{True} ;{{Goto Start;{{Goto End

{{Label End

The command {{ImportFile already reads the first line. So the command {{MessageBox {{DoImport} shows the first field. {{ImportNextLine} then opens the next line. (If there is no next line the Recorder jumps to the Label End)

If {{ImportNextLine} is used without {{If an error is shown if more lines than existing are read.

Hint: If you use {{ImportNextLine} a Loop change does not any longer switch to the next ImportFile line. That means you can use {{ImportNextLine} and Loops together.

 

Jump to a line: By using a parameter after the command {{ImportNextLine 5} a line in the import file can be accessed directly. (Here line 5). Example:

{{SetVarStartLine 5

{{ImportFile c:\MeineListe.txt

{{SetVarTemp {{ImportNextLine  {{VarStartLine}}
{{Label Start
{{MessageBox {{DoImport}
{{If {{ImportNextLine} = {{True} ;{{Goto Start;{{Goto Ende
{{Label Ende

 

Hint: After using the command {{ImportFile the imported file is locked. That means it can't be deleted or written to, until the macro ends, or another file is chosen by a consecutive {{ImportFile.

 

 

1.11     Editing Macros

 

 

It is possible to edit a recorded macro. To edit a macro press the tab "Macro Code". After pressing this button, a small editor with the actual macro is opened. The editor supports the following hotkeys:

CTRL C/X and CTRL V for copy/cut and paste. CTRL SHIFT HOME/END for selecting the whole text beginning from the actual cursor position. CTRL A selects the whole text (from beginning to end).

The editor contains also a Find (Hotkey: CTRL f), a Find Again (Hotkey: F3), and an Undo (Hotkey: CTRL z).

To simplify the entry of commands the hotkeys F9 ={{',  F11={{  and F12=}  can be used.

Debugging Help: If a macro has an error the guilty line is shown with a ===> in the macro window. After opening the editor, the cursor is placed at this guilty line. An abort (or {{Stop) produces also a ===>. That means you can abort a macro at a critical situation and the editor will show you the location where you stopped. The error arrow is removed during the next play or during saving the macro.

 

When editing a macro, you need to stick to certain rules:

The plus sign (+), caret (^), percent sign (%), tilde (~), parentheses ( ) Brackets ([ ]) and brace ({}).need to be enclose by braces.

To specify that any combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, enclose the code for those keys in parentheses.  For example, to specify to hold down SHIFT while E and C are pressed, use "+(ec)".  To specify to hold down SHIFT while E is pressed, followed by C without SHIFT, use "+ec".

To specify repeating keys, use the form {key number}.  You must put a space between key and number.  For example, {LEFT 42} means press the LEFT ARROW key 42 times; {h 10} means press h 10 times.

The commands {{1}, {{2}...{{n} have to be placed at the beginning of a line. All other commands can be placed after {{1}, {{2}...{{n}.

Commands which deliver an output (Examples: {{Var1}, {{RandomNumber 1,10} etc.) can be placed anywhere in a line. Commands not delivering an output needs to be placed at the beginning of a line. (Or after {{1}, {{2}...{{n}) Examples: {{SetVar1 10}, {{WriteLineToFile C:\Temp.txt, myText.

 

Hints: Additional quotation marks (") entered in the editor are automatically changed to the substitute quotation mark (Normally: å; Depending on the language). This character can be changed in the language assignment. (This is normally not necessary) The new substitute can be entered in the language file in line: QuotationMark=å. The language files can be found in the Recorder subdirectory: NLS.

 

 

1.11.1     Command Delays

 

      

 

 

 

1.11.2     Delayed Macro Start

 

 

The "Start Replay at" switch allows scheduling the run of a macro. This function can be used to start a large print job in the middle of the night, when nobody is disturbed by a long printout. Procedure: Activate switch 'Start Replay at', set the time to your needs and click 'Play'. Example: Day = 2, Hour = 03, minutes = 15.  Replay pressed at Monday 18:15. Macro starts Wednesday night at 03:15. (Days change at midnight.)

 

 

1.11.3     Scheduled Macro Start (Scheduled Tasks)

 

 

 

Hint: By using Windows Vista, Windows 7 or newer, the middle window (containing the scheduler tasks) will not be shown any longer. When you click the buttons the original Windows-"Scheduled Tasks" form will be opened. There you can add, edit, run or delete your macro tasks.

 

If you want to start a macro periodically you can use the tab 'Scheduled tasks'.

The Scheduler used the Windows function "Scheduled Tasks". Therefore also non-Recorder entries can be found in this window. To run a macro regularly (or also just once) it must be entered in tab 'Scheduled Tasks'. First choose a macro by clicking 'Browse'. 'Add Task' opens the original Windows "Scheduled Tasks" window. There the date and time can be set. The 'Scheduled Tasks' tab shows then the date/time when the macro is run the next time. The button 'Run Task' allows running the task immediately. When the scheduled time is reached, the scheduler starts the 'Mouse and Key Recorder'. The 'Mouse and Key Recorder' then starts the macro.

Hints:

The Mouse and Key Recorder uses the built in Windows function: "Scheduled Tasks".

Windows would allow to run the 'Scheduled Tasks' even then when nobody is logged in, or to run under another Windows user. For most macros this is not possible, because for sending mouse clicks and key strokes a visible window is necessary. (Scheduled tasks run in the background without a visible window if nobody is logged in, or if they run under a different user). Macros without mouse clicks and key strokes can run in the windowless background.

A macro started by a repeating Scheduled Tasks need to have an {{Exit at the end. If the started Recorder is still open, Scheduled Tasks can not start it again.

 

Security thoughts

As mentioned earlier on, the PC needs to be in a logged in state, if a macro e.g. at midnight has to run. It is also not possible to use a password protected screen saver, because the Recorder cannot unlock it. (For security reasons CTRL ALT DEL can just be entered by a real keyboard) That means the PC is open all night for all who have physical access to the PC.

A specialized screen saver can be downloaded from the following address: www.kratronic.com/tools/recorder/sw/ScreenLock/ScreenLock.zip. This screen saver protects the PC reliably, but it allows the Recorder to unlock it, and to lock it again after the macro has run.

Small disadvantage: During the macro run the PC is open. But this cannot be avoided, since the Recorder acts as a simulated human being sitting in front of the keyboard and mouse.

Important: On a VMWare Windows Client it is possible to break ScreenLock. That means do not use SceenLock on VMWare if security is important to you.

 

Windows XP/Vista/Win7: Windows XP, Vista and Win7 allow setting up a user, which has no password. But.. the Windows function "Scheduled Tasks" needs an user with password. (Entries, which contain a user without password, will never run!)

Possible solutions:

Add a password to the user. Disadvantage: Every time during login the password needs to be entered.

Use another scheduler: Disadvantages: Task entry is more complicated. The external scheduler must run all time.

Recommendation: Add a password to the user and enforce an automated login by the tool: "ALO". This small tool can be found at: www.kratronic.com/tools/recorder/sw/ALO.exe

 

Problems with Scheduled Tasks:

On certain XP-PCs the Scheduled tasks do not work. Reason for that is missing access rights or errors in the Scheduled Tasks components. During initialization the Recorder reads existing 'Scheduled Tasks'. If the C:\Windows\Tasks directory is access protected for the actual user or if the 'Scheduled Task' parts have an error then the Recorder stops reading the tasks and shows an error message in the 'Scheduled Tasks' Tab.

For changing the access rights see command XCacls in:

http://support.microsoft.com/kb/318754/en-us  (Be careful with this command, communicate with your IT first.

For patches for the 'Scheduled Task' parts see: (Windows XP)

http://support.microsoft.com/kb/812400/en

http://support.microsoft.com/kb/830924/en

Another possible measure: Start Mouse and Key Recorder as Administrator (Right click on Icon and choosing this option)

If Scheduled Tasks within the Recorder still do not want to work you might set the Windows Task Scheduler directly (START / Programs /  Accessories / System programs / Scheduled tasks). For the command see chapter: 'Command Line Function'

 

1.11.4     Mouse Entries

 

The 'Mouse and Key Recorder' offers two different ways to record mouse clicks:

 

Absolute Mouse Recording: In this mode all mouse clicks are stored related to the full screen. Mouse clicks are always on the same place on the screen, regardless of the location of the existing windows.

 

Relative Mouse Recording: In this mode the mouse clicks are stored relatively to the application window. That means a click on the Microsoft Word File menu will hit the file menu always, regardless where the Microsoft Word window is located on the screen and how large it is. Additional to the mouse coordinates the application window name is also stored to the macro. During macro run, the 'Mouse and Key Recorder' first switches to the window and then applies the mouse click. That means in the Relative Mouse Recording mode the window name must be the same during macro recording and macro run. Chapter 'Options' shows a way to ease this hard requirement. (Relative-Window-Filter) This chapter shows also how to switch between the absolute and relative mode.

Hints: Some applications get the focus too late after a mouse click. For these applications you get a wrong (or none) window name. When this happens a sound is played. Recommendation: Switch to the window by ATL TAB before you apply a mouse click.

Some Option windows need the parent window name for access. In such situations the mouse command needs to be corrected manually.

See also {{Switch for additional options. (Switching technique)

 

Mouse command syntax: The mouse command has the following syntax: {{Mouse button, click, horizontal pixel, vertical pixel, move-switch, Alt/Ctrl/Shift. (1 = left button, 2 = middle button, 3 = right button. 1 = single click, 2 = double click.)

Examples: {{Mouse  3, 2, 430, 283, 0,+^%  3 = right button, 2 = double click, 430 = pixel horizontal, 238 = pixel vertical, + = SHIFT, ^ = CTRL, % = ALT

Mouse drag and drop:

{{DragMouse 1, 1, 197, 307, 0, 371, 297  1 = left button, 1 = single click, 197 = pixel horizontal (first coordinate),  307 = pixel vertical (first coordinate),  371 = pixel horizontal (second coordinate),  297 = pixel vertical (second coordinate)

 

Relative-Mouse command syntax: When you record mouse clicks they normally are recorded as relative mouse commands. Example: {{RelativeMouse Microsoft Excel, 1, 1, 81, 198, 0.

Important: If the window name contains a comma (e.g. {{RelativeMouse Microsoft Excel - First,Second,and Last.xls, 1, 2, 153, 302, 0) then the window name must be shortened (must not contain a comma), otherwise wrong coordinates are used by the RelativeMouse command. Solution for the above example: {{RelativeMouse Microsoft Excel - First , 1, 2, 153, 302, 0. Another possibility is using a variable for the window name. Example: {{RelativeMouse {{StringWindow}, 1, 2, 153, 302, 0

Hint: Leading and tailing spaces are kept in {{RelativeMouse. Example: {{RelativeMouse     Microsoft Excel, 1, 2, 153, 302, 0). The spaces before Microsoft are kept. If there are no spaces in the real window name, the window will not be found. That means take care about the amount of spaces or use the command {{Trim.

 

Special functions:

The above commands are the ones you get when you record mouse activities. By changing some of the parameters manually you get the following special functions:

{{Mouse  1, 1, 430, 283, 1,+^%

A 1 at the location of the bold number means: Just place the cursor without click. Hint: This function works just with single clicks. Double clicks are processed normal despite the 1.

{{DragMouse 1, 1, 197, 307, 1, 371, 297, 50  

Bold 1 means:  Just move the cursor, no dragging. This function can be used to show the way of a mouse movement.

Bold 50 means: Half speed moving. (100 = normal speed, 200 = double speed)

{{DragMouse 1, 1, 197, 307, 3, 371, 297, 100  

Bold 3 means: Slow dragging (drag and drop with click). There are a few programs which do not like drag and drop very fast. In this case this option helps. The bold 100 defines again the speed (100 = normal speed).

{{Mouse  3, 2, 430, 283, 2      {{DragMouse 1, 1, 197, 307, 2, 371, 297, 0

A 2 at the location of the bold number means: The first mouse coordinate is "forgotten". {{Mouse will click exactly where the mouse stands, A {{DragMouse will start its drag a the actual mouse location.

 

Hint: {{Mouse  1, 1, 430, 283, 1 (2,3)  and {{Mouse  1, 1, 430, 283, 0 place the curser not always on the same location. Difference: sometimes1 pixel. Reason: The two commands have to use different coordinate systems. This leads to rounding errors.

 

Usually, mouse clicks are recorded live by clicking the icon  'Recording', and carrying out the necessary mouse clicks and drags. The 'Mouse and Key Recorder' uses the settings in field 'Focus Tolerance' (Menu: 'Tools' / 'Options' / 'Recording') to distinguish between clicks and dragging. The default is 3 pixels.

It is possible to deactivate mouse click recording (just the key strokes are then recorded). To deactivate mouse click recording click the menu 'Tools' / 'Options' / 'Recording' and then switch off the option 'Record Mouse Events'.

 

The Mouse and Key Recorder records just the mouse clicks and not the entire movement of the mouse-way. This makes the macro shorter and easier to edit. If you want to place the mouse without a click switch on the option: 'Suppress Mouse clicking for single clicks and drags' in menu: 'Tools' / 'Options' / 'Recording'. By using this option, recorded mouse clicks produce just a mouse positioning, mouse drags produce a smooth cursor slide from the starting to the end point (without any clicking). The speed of the cursor can be changed from 2 (2% of the original speed) to 10'000 (100 times faster than the original speed). Example {{DragMouse  1, 1, 82, 64, 1, 584, 774, 50  = 50% of the original speed.

 

MouseDownTime: For games sometimes the mouse button must be pressed for a certain time. The command {{MouseDownTime allows to set this time. Example: {{MouseDownTime 3000. Every mouse-click keeps down the mouse button for 3 seconds. {{MouseDownTime 0 sets back the click to the default time.

 

Mouse recording in Windows Vista/Win7:

In Windows Vista/Win7 it is no longer possible recording key strokes and mouse clicks in a browser (e.g. Internet Explorer). (Reason: Measures against viruses and Trojan horses which want to do password pishing). To be able recording mouse clicks anyway, the menu: 'Insert' / 'mouse entry' (Hotkey F6) was added.

 

 

 

 

1.11.5     Status Information

 

 

At the bottom of the 'Mouse and Key Recorder' form, some status information can be found. There is a command counter and a status line. The command counter shows the line of the processed command and the status line shows every 1,5 sec. the actual command.

 

 

1.11.6     Command Line Function

 

The 'Mouse and Key Recorder' allows the use of command line parameters. The following command-line starts 'Mouse and Key Recorder', loads the macro "MyMacro" and starts the macro:

"C:\Program Files\KraTronic\Recorder\RECORDER.EXE" "C:\My Documents\MyMacro.krc". This function allows starting a macro by an icon. This feature can be used if an application needs certain adjustments every time it is started. (In example: Setting a special font and layout). How to create an icon: On the desktop right mouse click, NEW, SHORTCUT, enter the above (or any) command line, then the name of the icon.

If you want to keep the 'Mouse and Key Recorder' in the background during the macro run you can set the window size to minimized in your icon.

If you want to start the Mouse and Key Recorder by command line without an icon and keep it in the background you can add the command line option: -MKRMinimize. Example: "C:\Program Files\KraTronic\Recorder\RECORDER.EXE" "C:\My Documents\MyMacro.krc" -MKRMinimize.

If you want to hide the Mouse and Key Recorder during macro run you can add the command line option: -MKRHide. (Command is case sensitive) The Recorder will then not be shown even not in the taskbar. Example: "C:\Program Files\KraTronic\Recorder\RECORDER.EXE" "C:\My Documents\MyMacro.krc" -MKRHide. Important: Because the Recorder is hidden you can not close it after the macro has ended. Every macro called with option -MKRHide should therefore have the command {{Exit at the end of the macro. Do not use {{MessageBox2 in a macro started hidden. (MessageBox2 will also be hidden).

If you want to load a macro but not yet start it, you can use the option: -NoRun. Example: "C:\Program Files\KraTronic\Recorder\RECORDER.EXE" "C:\My Documents\MyMacro.krc" -NoRun

 

The command line functionality also allows starting a macro by an external scheduler.

 

Command Line Variable Parameters

 

It is possible to hand over Command Line variable parameters ({{Var and {{String) to a macro. The following parameters are possible: --Var0, --Var1 … --Var9   and   --String0, --String1 … --String9

Example: "C:\Program Files\KraTronic\Recorder\RECORDER.EXE" "C:\My Documents\MyMacro.krc --Var1 4711 --String2 My Text".

The automatically started macro 'MyMacro.krc' can now use the variables {{Var1 and {{String2.

Important: The file name must always be the first parameter in a Command Line.

 

 

1.11.7     Calling a Macro by a Hotkey

 

There are two possible ways to start a macro be a hotkey. The first way starts the Mouse and Key Recorder and the macro by a command line in an icon. The icon itself contains a hotkey. The second way uses a built in hotkey table.

 

First way:

To start the 'Mouse and Key Recorder' by a hotkey, an icon as described in the previous paragraph 'Command Line Function' has to be created. The property sheet of this icon contains a line where a hot-key can be defined. Hint: These hotkeys just work if the icon is located on the desktop.

 

Second way:

The menu: 'Tools' / 'Options' / 'General' contains a button: 'Assign Macro Hotkeys'. This button lets you define hotkeys. (See Chapter: 'Options' for a comprehensive description of the hotkey creation.) The option: 'Use Macro Hotkeys' must be enabled to use the hotkeys defined in Edit Macro Hotkey. Hint: These 'second way hotkeys'  only  work when the Mouse and Key Recorder runs.

Hint: Hotkeys do not work when Internet Explorer has the focus. (Microsoft restriction against phishing)

 

 

1.11.8     Creating a 'Mouse and Key Recorder' icon

 

The previous two sections mentioned the creation of a 'Mouse and Key Recorder' icon. Here is the procedure:

Click on your PC desktop with the right mouse key and choose New and then Shortcuts. An icon wizard is started. Fill in the command line as described in chapter 'Command Line Function'. Choose a proper name for your new icon. After finishing the icon wizard, click with the right mouse key on the new icon. On tab Link enter your desired hot key combination and the state of the 'Mouse and Key Recorder' after starting (minimized, normal).

 

 

1.11.9     Debug-Log-File

 

The Mouse and Key Recorder contains lots of commands ({{If, {{Goto, etc), which allows to create quite complex macros. To make debugging easier the Mouse and Key Recorder contains a debug log file function. This function can be activated in the menu : 'Tools'  / 'Options' / 'Replay'. (Switch: 'Log Replay') This function forces the Recorder to write all activities to a file. The following entries are made to the Log-File:

- First line: Date and Time, Seconds since macro start.

- Second line: The original macro line

- Third to fifth line: Resolved macro lines. That means the content of the variables are shown.

 

The button: 'Open Log-File' allows opening the previous created log file.

 

Hints: The running-time 'Seconds since macro start' uses the seconds since midnight. That means if a macro runs over midnight this running-time will not be correct after midnight.

See also command: {{ResetLogFile}

 

1.11.10     Debug Window

Debugging can be supported by the Debug Window. The command {{DebugOn} switches on this debug window. Each time a variable is read or written, the name, the value und the accompanied command are written into the debug window. The newest entries are placed at the top of the window; the older entries are moved downwards. {{DebugOff} ends the variable reporting, but lets the debug window open.

 

 

1.11.11     Options

 

The Mouse and Key Recorder options allow customizing some functions. You can find the options under menu 'Tools'. The options are separated into five groups: General, Replay, Edit, Recording and Language

 

 

Tab 'General' contains the following options:

 

Remember  Window Size & Position:

The Mouse and Key Recorder remembers by default the location and size it had the last time when it ran. This switch allows turning off this behavior.

Keep Recorder Window always on top:

Keeps the Recorder always above all the other windows. This is very handy if you want to test a macro. That way you can always see what's going on. (Which command is processed at the moment) Hint: If the Recorders starts a MessageBox and the box appears behind the Recorder there is not possibility anymore to close the box and also the Recorder… (Use the Taskmanager to kill the Recorder in this case)

Start Recorder with Tab 'Macro Code':

If you often create new macros this option is quite handy. You can start creating a macro immediately after starting the Recorder without having to change the tab.

Print Macro:

This button allows printing out the actual macro to the default printer. (Listing)

Hint: If you want to use another printer or if you want to format the macro copy the macro from the Recorder by CTRL a  and CTRL c and paste it to Microsoft Word by CTRL v. In Word you can format it and print it to any printer.

Use Macro Hotkeys:

This switch activates the macro hotkeys. Macro hotkeys allow starting a macro by just pressing a key combination. Additionally the hotkeys for Stop, Pause, F11, {{, etc. are activated by this switch. Hint: Hotkeys do not work when Internet Explorer has the focus. (Microsoft restriction against phishing)

Hint: Activating this switch has a small side effect. The special keys like ^ and ¨ (on Swiss keyboard) act differently (^ ¨ are combination keys. They can be used to crate e.g â, by pressing first ^ and then a). If the macro hotkeys are activated (and the Recorder runs) then at each keystroke two characters are entered e.g. ^^, ¨¨. If this needs to be avoided, this switch has to be deactivated or the Recorder has to be closed.

 

Assign Macro Hotkeys:

After clicking this button the following window appears:

 

 

Adding new Hotkeys:

Use 'Browse…' to select the macro. Adjust CTRL, Shift, Alt and the key to your needs. Click 'Add'.

Removing Hotkeys:

Select a line. Click Delete.

Restriction: Temporary macros cannot be entered in the Hotkeys window.

 

 

Switch to Tab 'General':

During playing a macro the Recorder changes to Tab 'General'. When the macro finishes the Recorder jumps back to the tab it showed before.

Show Toolbar:

If this switch is turned off, the toolbar is removed during macro replay.

Show Status bar:

If this switch is turned off, the toolbar is removed during macro replay.

Move aside:

During macro replay the Recorder window is moved to one of the corners.

Minimize:

During macro replay the Recorder window is minimized to the taskbar.

Stop-Hotkey:

This option allows choosing the key for stop and pausing. (Combined with Alt: = Stop, Combined with Shift: = Pause)

Log replay:

If this switch is on during macro replay an error-search-log is created. By using {{ResetLogFile} a second log file will be created. This log file can be opened by clicking button: Log 2

Left handed mouse function:

If the Windows setting for the mouse is set to left handed this option must also be activated to force the Recorder to click the proper mouse buttons.

 

 

Insert Delay:

This delay is used if a command {{Delay is entered by menu: 'Insert' / 'Delay' or by toolbar (sandglass)

CheckFocus Delay:

Defines the time between clicking a focus command in the menu and entering the focus in the macro window

WaitForFocus Timeout:

Default value for the timeout used in focus commands

Hotkeys:

The hotkey settings let you choose your individual hotkey for the 'Mouse and Key Recorder'. Default setting is: CTRL-ALT-SHIFT-F12. The hotkey can be used to enter {{Delay and {{Switch commands. For delays see chapter: ' Recording macros'. The {{Switch hotkey works the following way: First you switch to your application by ALT TAB, then you press all together CTRL-ALT-SHIFT-F12 and then again F12. That way a {{Switch command is added to your macro. If you have changed the hotkeys to CTRL F3 you would press CTRL-F3 together and then F3.

Important: When you set the hotkey to just an Fn key without CTRL or ALT or SHIFT (Example: F12) then the hotkey works just for delays but not for entering {{Switch commands.

Hint: Hotkeys do not work when Internet Explorer has the focus. (Microsoft restriction against phishing)

Show commands in alphabetic order:

Commands in the 'Insert Commands' Window are shown in groups. E.g. {{Var and {{SetVar are located next each other. Some people prefer alphabetic order. This option allows to have 'Insert Commands' in alphabetic order.

Font Size:

This font size is used in the edit window

Font:

This font is used in the edit window

 

 

Record Mouse events:

By switching off this option just the keystrokes are recorded

Window relative Mouse events:

This option allows to activate windows relative mouse recording. See chapter: ' Mouse Entries' for a comprehensive description of absolute/relative mouse recording.

Use rel. Window Filter:

The Window Filter allows to simplify finding window names. Often window names change for each window. Example: Document2 - Microsoft Word. The Window Filter allows searching just for Microsoft Word. In this example Microsoft Word would be entered into the filter file. When recording a macro just Microsoft Word will be used for {{Switch and relative {{Mouse commands.

To be able to use the Relative Windows Filter, a filter file must exist. The 'Mouse and Key Recorder' installation installs such a file with the most used filenames. (MS Office, IE, Corel). You can then extend or adjust the entries. Later upgrades will not change the file you have already changed.

You extend the filter file with pure window names. Every time the 'Mouse and Key Recorder' finds this pure name in the real window name, it uses the name in the filter for the mouse or the (hotkey) {{Switch command.

Hint: If you need to add names that contain another name, you need to consider the sequence in the filter file. Example: 'Explorer' and 'PdmExplorer'. Place the longer name before the shorter one: In the above example: 'PdmExplorer' before 'Explorer'.

Focus Tolerance:

This value (pixel) is used to define the tolerances for catching the focus and to distinguish between a mouse click and a mouse drag.

Suppress Mouse clicking for single clicks and drags:

If this option is activated, the mouse is just set to the recorded location but no click is carried out. If a mouse drag is recorded the mouse glides slowly over the screen (without any clicking or real dragging). See also chapter: 'Mouse entries'

Add Delays during Recording:

This option was added because many users asked for… If this option is activated, for every line a {{Delay command is added during recording. The delay contains the real time needed for the next command.

Show blinking icon during recording:

This option allows showing a blinking icon during recording. The icon stays always on top.

 

   

 

Use hotkeys for switching on and off recording:

This option activates the hotkeys for switching on and off recording. This allows in a fast way to interrupt recording for a short period, changing something and continue recording.

Hint: If the blinking icon is also used, the focus is on the icon after switching on recording. To go back to the actual application ALT TAB must be used.

 

 

 

Keyboard and user interface language:

The Keyboard-language drop down menu lets you choose your keyboard language. About 30 keyboard languages are included in the installation. If your keyboard language is not included please contact Kra-Tronic Corp.

User interface languages:

The Mouse and Key Recorder offers two user interface languages (English and German). After switching to another language, the user interface texts are changed immediately.

 

 

1.12     Help Menu

 

 

The Help contains important information about the Mouse and Key Recorder.

Important Hints: This short manual informs about basic precautions to avoid problems with 'running wild' macros.

The Manual contains this manual/help

The Sample Macro shows a simple macro. This macro shows a few Recorder functions

The About shows the version number and contains also a direct link to the Mouse and Key Recorder homepage

 

 

1.12.1     Macro List

 

The special hotkey 'Shift F1' shows the following 'Macro Overview' list:

 

 

In the first part the list shows all assigned hotkeys, the second part shows all the macros in the directory, which was used the last time when opening a macro. If macros have a macro-description this description is shown after the macro name.

A selected macro can be loaded or even started from this list.

 

1.13     Debugging

 

Recording, writing or editing a macro is sometimes not as easy as it looks at the first view. Some errors are nasty and difficult to find. The following hints give you some ideas how to debug your macro:

Syntax:

As long as you record a macro, syntax errors are not a topic, but as soon as you edit or extend them, syntax becomes important. That means: Record as much of your macro you can. (The recorded part is free of syntax errors). If you need to add new commands use menu Insert | Command. The insert command window gives you hints how a command is built and shows also a small help window. For complicated commands like {{If use the Recorder Help function (F1) to get a comprehensive information.

Stopping a macro:

Sometimes you have the need to stop a macro immediately. There are several possibilities to stop a macro.
- Stop-Icon (Quadrate in right top corner)

- Menu: Replay | Stop

- Hotkey: ALT Break/Pause  (Notebook Fn ALT Break/Pause) (Not working if IE has focus).

  Remark: Stop-Hotkey can be chosen in the options)

- Command {{Stop in the macro

Pausing a macro:

The hotkey: SHIFT Break/Pause  (Notebook Fn SHIFT Break/Pause) pauses your macro. Pressing again the same key makes your macro continue again. Pausing means the macro stands still at the place you pressed the hotkey. All focuses stay as they are. That means you can do some possibly needed changes and continue the macro afterwards. Important: For continuing the macro you must have the same focus situation you had, when you paused the macro. Otherwise continuing the macro causes a mess…

Hints: If a Delay is running, pause is activated after Delay has ended. Pause-Hotkey can be chosen in the options.

Slow Macro-Run:

When you have finished a macro you should run it first in slow mode. Slow mode is activated by enlarging the value in 'Line Delay' (Tab General). Setting this value to e.g. 1000 causes a delay for one sec. for each line.  That way you can easily watch what the macro does and stop it in time, if something goes wrong. If you have a long macro and you want to supervise just a part of it, you can use the command: {{SetGenDelay.

If you have the Recorder window with tab 'Macro Code' visible (maybe in a corner you do not need), you can see which command is carried out at the moment (the first two characters of a line get blue)

Macro Speed:

Computer programs are written for being used by human beings. Program developers do not expect a user like the Mouse and Key Recorder, which can operate a program incredibly fast. So they never test their program with such a fast user. That means if the Mouse and Key Recorder runs a macro too fast, all kinds of errors can occur in the target application. This is especially true for mouse clicks. (For keystrokes the Recorder waits until the last stroke is processed - except by using {{SendTextSpecial}).

Recommendation: Add {{Delays where necessary or slow down the whole macro (or parts of the macro) by 'Line Delay' or by {{SetGenDelay.

Log-Book:

A log-book logs all activities during a macro run. This function can be activated in the menu: 'Tools'  / 'Options' / 'Replay'. (Switch: 'Log Replay').The following entries are written to the Log-File:

- First line: Date and Time

- Second line: The original macro line

- Third to fifth line: Resolved macro lines. That means the content of the variables are shown.

 

The Log-Book allows to retrace the ways the macro used (in case of an {{If ), which value a variable had to which time, how a Loop filter ( {{<5} ) acted, etc.

Debug-Window:

Debugging can be supported by the Debug Window. The command {{DebugOn} switches on this window. Each time a variable is read or written, the name, the value und the accompanied command are written into the debug window. The newest entries are placed at the top of the window; the older entries are moved downwards. {{DebugOff} ends the variable reporting, but lets the debug window open.

 

1.14     Special Functionality: Automated Software Test

 

The 'Mouse and Key Recorder' contains several commands, which allow you to use this Recorder for automated software tests. If you write software or macros for WinWord and Excel, you need to test your creation by carry out all possible functions with a lot of different entries and data. These tests can become quite large and time consuming. Even worse, if you change a small part of your software you should again test all the functions of your software. (Only then are you sure, your new function has no bad side effects to an already existing once.)

The following 'Mouse and Key Recorder' commands are handy for such automated software tests:

{{CheckFocus, {{WaitForFocus, {{WaitForEndFocus, {{WaitForScreenChange, {{FindPattern, {{GetPixel, {{Goto, {{Label, {{FindFile, {{Master, {{LoadMacro, {{WriteToFile, {{RandomNumber, {{RandomString, {{If..Then..Else, {{MessageBox2.

Let us assume a typical software test situation. The Recorder macro starts your application. (Assumption: Your application is a text editor) You want to be sure your application has started. So you check the actual focus. If the focus is on a wrong location, your application might have not started properly. Depending how you use this command the macro ends now or it jumps to a label. If you decide to jump to a label you could write some code, which sends a pager message to your pager. If your test runs for hours you can let your PC alone and you are alarmed, as soon the automated software test has found an error.

Assuming during your test you have written some text to your editor and you are going to store it now. Depending on the situation on your hard disk (file new or file already existing) different forms appear. Again you can use {{CheckFocus to test the situation and react according to the situation. The following script shows such a solution:

"{{Start notepad

Test

{ENTER}

%f  {{' File

a  {{' Save as

C:\RecTest\John.txt

%s  {{' Save

{{Delay 1000}

{{If {{CheckFocus 82, -1, 95, 23, 3, 3, 3, 3} = {{True} ;%y;

%f  {{' File

x  {{' Exit

 

If this macro is run the first time, the file John.txt does not yet exist on the hard disk. That means {{CheckFocus will return False and nothing special is done. (no text after’;’) If John.txt already exists, {{CheckFocus returns a True and the command %y (Yes) is carried out.

 

 

1.14.1     Function description

 

 

1.14.1.1     {{CheckFocus

This function checks if the focus during the macro run is on the same location as it was when the macro was recorded. (The focused part in a window is that one, which is addressed when you use the keyboard.)

You can add such a {{CheckFocus entry to your script by clicking menu:  'Insert' / 'Focused object' / 'Check Focus'. After clicking 'Check Focus' button you must change to the application, which contains the focus to be tested within three seconds. This time (3 sec) can be changed in the options. After the delay you get an entry similar to this one:

{{If {{CheckFocus 82, 288, 95, 23, 3, 3, 3, 3} = {{True};;{{ShowError}. The first four numbers stand for: Distance to the top border, to the left border, width of the part, height of the part. Example:

 

 

{{CheckFocus 63, 28, 81, 25. "Yes" has the focus. 63 pixel are between the top border and the button, 28 pixel between left border and button. The button has a size of 81 * 25 pixel.

This little window can be moved to any place on your desktop, you always get the same numbers. Restriction: Parts (example: Icons) on the desktop cannot be checked by {{CheckFocus. They have always the same numbers regardless of their position.

 

Sometimes the text in the window changes. Example:

 

 

Depending on the length of the text, the buttons move horizontally. You still can check the "Yes" button: {{CheckFocus  71, -1, 49, 25. The "-1" means: Do not test the distance to the left border.

The -1 can be used on any of the four numbers.

 

But what are we going to do if the buttons are arranged next to each other like in the next example ?

 

 

The solution is tolerances. You can define tolerances for every number. Example: {{CheckFocus 63, 105, 95, 23, 0, 20, 0, 0. That means the "Yes" button can move +- 20 pixels without causing an error. (100 pixels are about 3 cm or 1.2 inches on a 17’’ screen with a resolution 1024*768).

Sometimes the windows on your screen have some ‘jitter’. That means now and then they are drawn one pixel away from the recorded place. To overcome this behavior, the 'Mouse and Key Recorder' adds by default a tolerance of 3, 3, 3, 3 to your {{CheckFocus. You can adjust this value in the Options window. (Entry: Focus Tolerance). A ‘Focus Tolerance’ value of 0 means: No tolerances are added to the command.

 

If {{CheckFocus can’t find the part at the expected location it returns a "0". Within a {{If command you can test this with the key-word {{True} and {{False}. If you store the value of {{CheckFocus to a variable the "0" or "1" are stored. If you use the key-word {{ShowError} in the Then- or Else-part, then an error window is shown and the macro ends. (a ‘===>>’ is placed in front of the guilty command in the macro window. If logging is switched on a second line in the log shows the found coordinates).

 

 

1.14.1.2     {{WaitForFocus, {{WaitForEndFocus

{{WaitForFocus can be triggered by the menu: 'Insert' / 'Focused object' / 'WaitForFocus', {{WaitForEndFocus can be triggered by 'WaitForEndFocus'.

The command {{WaitForFocus works very similar to {{CheckFocus. Additional to the four numbers a time-out time is added as fifth parameter.

Example: {{If {{WaitForFocus 63, 14, 95, 23, 10, 3, 3, 3, 3} = {{True};;{{ShowError}. The default value for the time-out can be set in the Options. {{WaitForFocus waits for the focused window part during the time-out time. In the above example it waits for 10 seconds. If the required window part appears within the time-out time {{WaitForFocus returns a "1" (True). If the window part does not appear within the required time, {{WaitForFocus returns a "0" (False). {{WaitForFocus and {{WaitForEndFocus allow to use the -1 parameter and the above described tolerances.

{{WaitForEndFocus simply waits for an existing focused part to disappear. With this command it is possible to wait for the end of an operation.

 

Restrictions:

·         Some applications have only one window, even though lots of buttons or icons appear. There the different Check-Focus functions cannot be used.

·         The Check-Focus functions can also not be used on an Internet browser. Regardless of the content, the Check-Focus functions always deliver the same coordinates. For a workaround see: {{WaitForIEReady, {{WaitForScreenChange, {{FindPattern and Macro examples.

 

 

WaitForFocus Example:

Open the Recorder. Open also Notepad manually (Start | Run | Notepad.exe). In the Notepad click File | Open. In the new window click on button Open (to set the focus on this button. The button gets a dashed frame.) On the Recorder activate WaitForFocus. Within 3 seconds change to notepad by using ALT TAB. The recorder asks now for a timeout. Set it to 100 and click ok. You get the following macro line: {{If {{WaitForFocus 322, 478, 75, 23, 100, 3, 3, 3, 3} = {{True};;{{ShowError}. Add the command {{Beep as additional line to the macro (AddCommand, {{Beep). Close the Open window of Notepad. Replay your macro. Nothing happens now; just the timeout is counting down. In the Notepad click now File | Open. In the new window click on button Open. At this moment you will hear a beep. That means the Recorder has now sensed the right focus and continues..
That means to use this command you first must create the focus situation and record it. Then during macro run the Recorder will wait until this focus situation appears or the timeout time runs out.

 

 

1.14.1.3     {{MessageBox2

The normal {{MessageBox shows a window in the center of the screen. During software test, the screen is often filled by the software under test. The message box window appears then,  often beyond the other windows. The {{MessageBox2 appears always on top of the 'Mouse and Key Recorder'. (As long as the 'Mouse and Key Recorder' is visible.)

{{MessageBox2 shows a text to the user. Example: {{MessageBox2 Please insert CD. {{CR} CD must not be copy protected !

The {{CR} keyword allows you to show more than one line for the text.

Important: After the command {{MessageBox2 a command {{Switch.... must follow, otherwise the Recorder will continue with the focus on itself !

{{MessageBox2} must not be used after a {{Minimize} command. Otherwise the MessageBox2-window cannot be closed anymore on certain operating systems.

 

 

1.15     Keyboard Language

 

The Mouse and Key Recorder installs 30 keyboard language files. If a keyboard language is missing, a new one must be created. In this case please contact Kra-Tronic Corp.

 

 

1.16     Macro Examples

 

There are two groups of macro examples: Examples for individual commands and examples for solving general tasks.

Macros with the remark 'Running example' can be copied into the Recorder. They run on all operating systems and languages.

 

 

1.16.1     Examples for individual commands (or command groups)

 

1.16.1.1     Comments

 

(Additional commands: {{Start, {{Delay)

 

(Running example)

This example shows the difference between {{' and {{''

 

{{Start Notepad

{{Delay 1000} {{' Milliseconds

Line1 {{' My Comment

Continue at the same line.

{ENTER}

Line2 {{'' My Comment

Continue at the same line.

{ENTER 2}

As you can see {{}{{}'' keeps the space before 'Continue…

 

 

1.16.1.2     {{Start, {{StartAndWait

 

(Additional commands: {{ExtDelay)

 

(Running example)

A Notepad is started normally, then a calculator is started with {{StartAndWait. Only when the Notepad is closed the macro continues.

 

{{Start Notepad

{{Delay 1000} {{' Milliseconds

This Notepad  was started normally: {{}{{}Start Notepad

{ENTER 2}

In 10 sec.  a calculator is going to be started with: {{}{{}StartAndWait Calc

{ENTER}

Only when you close the calculator, the macro continues

{ENTER}

Well, please close the calculator....

{ENTER 2}

{{ExtDelay 10 {{' Wait for 10 sec.

{{StartAndWait calc

Well, now it continues.....

 

 

1.16.1.3     {{DOS

 

(Additional commands: {{ImportFile, {{ImportSeparator, {{DoImport}, {{FlashBox, {{Goto, {{Label, {{DeleteFile, {{If)

 

(Running example)

By using the DOS box a Dir command is carried out and the result is stored in a text file. This text file is then opened by Notepad. Additionally all listed files are shown in a FlashBox in succession. To tide up the situation the text file is closed at the end.

 

{{DOS MKDir C:\DOS-Test

{{DOS Dir /B > C:\DOS-Test\DirList.txt

{{Delay 1000} {{' Milliseconds

{{Start Notepad  C:\DOS-Test\DirList.txt

{{Delay 1000} {{' Milliseconds

{{ImportFile C:\DOS-Test\DirList.txt

{{ImportSeparator >

 

{{Label Start

{{FlashBox {{DoImport} | 1 | Dir-List Display | Continue | Cancel

{{Delay 500} {{' Milliseconds

{{If {{VarFlashBoxAnswerX55} = {{True} ;;{{Goto Ende

{{If {{ImportNextLine} = {{True};{{Goto Start;{{Goto Ende

 

{{Label Ende

{{Delay 1000} {{' Milliseconds

{{ImportFile {{MacroPath}{{MKRFileName}

{{DeleteDir C:\DOS-Test | {{True}

 

Hints:

 

 

1.16.1.4     {{Switch, {{SwitchOrStart

 

Additional commands: {{DOS, {{Start

 

(NOT everywhere running example)

This example shows different switch options

 

{{DOS MKDir C:\Swi-Test

{{Delay 300

{{DOS dir /B > C:\Swi-Test\DirList.txt

{{Delay 1000} {{' Milliseconds

{{Start Notepad  C:\Swi-Test\DirList.txt

{{Delay 1000} {{' Milliseconds

{{Switch #MKRX5#

{{Switch Dir

{{Delay 300

{{SwitchOrStart DirList.txt | Notepad  C:\Swi-Test\DirList.txt

{{Delay 300} {{' Milliseconds

{{DeleteDir C:\Swi-Test | {{True}

{{Delay 300

{{Switch <=DirList.txt

{{Delay 300

{{Switch DirList.txt=>

 

Hints:

 

 

1.16.1.5     {{Loop

 

(Additional commands: {{1}, {{}, {{LeftLoop, {{RightLoop, {{Offset, {{SetLoop)

 

(Running example. Condition: Set field: Loops in tab 'General' to 10.)

This example shows diverse commands which are possible with Loops.

 

{{1}{{Start Notepad

{{1}{{Delay 1000} {{' Milliseconds

{{1}This is the first loop

{{1}{ENTER}

{{2}This is the second loop

{{2}{ENTER}

We are now in loop: {{Loop}

{ENTER}

{{>100}This is a loop > 100

{{>100}{ENTER}

{{3}This is the third loop

{{3}{ENTER}

{{3}The cursor moves now {{}{{}LeftLoop 5 to left and then again {{}{{}RightLoop 5 to right.

{{3}{{Delay 1000} {{' Milliseconds

{{3}{{LeftLoop 5

{{3}{{Delay 1000} {{' Milliseconds

{{3}{{RightLoop 5

{{3}{{Delay 1000} {{' Milliseconds

{{3}{ENTER}

{{4}Now we set the loop up to 6

{{4}{ENTER}

{{4}{{SetLoop 6

{{8}Now we apply an {{}{{}Offset of 100

{{8}{ENTER}

{{8}{{Offset 100

{{n}This is the last loop

{{n}{ENTER}

 

 

1.16.1.6     {{WaitForKey

 

(Additional commands: {{MessageBox)

 

(Running example)

 

{{MessageBox Please after clicking OK press any key{{CR}(Don't use key combinations like  ALT f)

{{WaitForKey}

{{MessageBox Key: '{{StringWaitForKeyX55}' was pressed.

 

 

1.16.1.7     {{SetVar, {{Var, {{SetString, {{String

 

(Additional comands: {{SetGlobVar, {{GlobVar, {{SetGlobString, {{GlobString, {{DivVar, {{MulVar, {{Goto, {{Label)

 

(Running example)

This example shows the how to work with variables. Also using indirect variables is shown by creating an array.

 

{{Start Notepad

{{Delay 1000} {{' Milliseconds

Saving the number 133 to variable VarNumber

{ENTER}

{{SetVarNumber 133

Saving the number 266 to global variable VarNumberGlobal

{ENTER}

{{SetGlobVarNumber 266

Saving the text 'My text 1' to  variable StringText

{ENTER}

{{SetStringText My text 1

Saving the text 'My text global' to variable StringTextGlobal

{ENTER 2}

{{SetGlobStringText My text global

 

Viewing variable contents:

{ENTER}

VarNumber = {{VarNumber}

{ENTER}

GlobVarNumber  = {{GlobVarNumber}

{ENTER}

StringText  = {{StringText}

{ENTER}

GlobStringText = {{GlobStringText}

{ENTER 2}

 

Calculating numbers and combining texts:

{ENTER}

Adding 100 to VarNumber  and dividing by 5

{ENTER}

{{IncVarNumber 100

{{DivVarNumber 5

Ading 200 to GlobVarNumber and multiplying with 3.5

{ENTER}

{{IncGlobVarNumber 200

{{MulGlobVarNumber 3.5

Adding the text 'Additional text'  to VarText

{ENTER 2}

{{SetStringText {{StringText} Additional text

 

Viewing variable contents:

{ENTER}

VarNumber = {{VarNumber}

{ENTER}

GlobVarNumber = {{GlobVarNumber}

{ENTER}

StringText  = {{StringText}

{ENTER 2}

 

Creating and viewing an Array:

{ENTER}

10 random numbers shall be put to an array

{ENTER}

{{SetVarArrayCounter 1

{{Label Start

{{SetVarArray{{VarArrayCounter} {{RandomNumber 1,100}

{{IncVarArrayCounter 1

{{If {{VarArrayCounter} <= 10 ;{{Goto Start;

 

{{SetVarArrayCounter 1

{{Label StartView

VarArray{{VarArrayCounter} = {{VarArray{{VarArrayCounter}}

{ENTER}

{{IncVarArrayCounter 1

{{If {{VarArrayCounter} <= 10 ;{{Goto StartView;

 

Hint: The example is self explaining, when you let it run :-)

 

 

1.16.1.8     {{Ask, {{WriteAsk

 

(Additional commands: {{SetClipboard, {{ClipBoard, {{RandomString)

 

(Running example)

This example shows how to work with user queries and clipboard.

 

{{AskQuesiton1 How is the abbreviation of the Mouse and Key Recorder ? |MKR

{{AskQuestion2 How much did the first version of the MKR cost ? |15

{{Start Notepad

{{Delay 1000} {{' Milliseconds

{{SetClipBoard {{WriteAskQuesiton1}

The abbreviation  of the Mouse and Key Recorder is:

^v {{' Microsoft command: Paste)

{ENTER}

{{SetClipBoard {{WriteAskQuestion2}

The first MKR version did cost: ^v $

{ENTER 2}

{{SetClipBoard {{RandomString 32, !, ~}

Random characters: ^v

 

Hint: For special characters (here generated by RandomString) the ClipBoard must be used. Some special characters have special functions in the Recorder. e.g. % means ALT. See also {{SendTextSpecial+}

 

 

1.16.1.9     {{SerialTime

 

(Additional commands: {{Div, {{Mod, {{IncVar, {{DecVar, {{MessageBox)

 

(Running example)

This example shows the conversion from SerialTime to Days, Hours, min. and sec.

 

{{SetVarStStart {{SerialTime}

{{MessageBox Please wait a few seconds for seeing the effect.

{{SetVarStEnd {{SerialTime}

{{DecVarStEnd {{VarStStart} {{' waited time

{{IncVarStEnd 93720 {{' Adding 1 Day, 2 hours und 2 min.

{{SetVarStDelta} {{VarStEnd}

{{SetVarStMin {{Div {{VarStDelta} | 60}

{{SetVarStSec {{Mod {{VarStDelta} | 60}

{{DecVarStDelta {{VarStSec}

{{SetVarStHour {{Div {{VarStDelta} | 3600}

{{SetVarStMin {{Mod {{VarStDelta} | 3600}

{{DecVarStDelta {{VarStMin}

{{SetVarStMin {{Div {{VarStMin} | 60}

 

{{SetVarStDay {{Div {{VarStDelta} | 86400}

{{SetVarStHour {{Mod {{VarStDelta} | 86400}

{{SetVarStHour {{Div {{VarStHour} | 3600}

 

{{MessageBox {{VarStDay}-{{VarStHour}:{{VarStMin}:{{VarStSec}

 

The macro shows: e.g. 1-2.2.14  (1 Day, 2 hours, 2 min and the waited 14 seconds.

Hint: Instead of {{IncVarStEnd 93720 the new command {{AddSerialTime could be used.

 

 

1.16.1.10     {{WaitForTime

 

Additional commands: {{CreateSerialTime, {{Replace,  {{Time.

 

(Running example)

This example shows how to create a macro which is pausing during night

 

{{' Macro dos not run between 20:30 and 5:15

{{Label Start

{{SetStringMyTime {{Replace {{Time} | - | , | 1 | -1}

{{SetVarMySerialTime {{CreateSerialTime 1970,1,1,{{StringMyTime}}

{{If {{VarMySerialTime} > {{CreateSerialTime 1970,1,1,23,30,00} ;{{WaitForTime X:05:15:00;

{{'.. Macro commands which needs to run during daytime

{{'..

{{Goto Start

 

 

1.16.1.11     {{CreateSerialTime, {{AddSerialTime

 

Additional commands: {{SerialTime, {{Replace, {{Time.

 

(Running example)

This example shows how to run different macro parts during night time and during day time.

 

{{' Macro switches between 20:30 and 5:15 to the 'Night-Macro'

{{Label Start

{{SetStringMyTime {{Replace {{Time} | - | , | 1 | -1}

{{SetVarMySerialTime {{CreateSerialTime 1970,1,1,{{StringMyTime}}

{{If {{VarMySerialTime} > {{CreateSerialTime 1970,1,1,23,30,00} ;;{{Goto NotWithinNightBreak

{{SetVarMySerialTimeTarget {{AddSerialTime 0000,00,00,08,45,00} {{' 20:30 plus 8h 45 = 5:15

{{Label WaitForMorning

{{'.. Macro commands which needs to run during night time

{{'..

{{If {{VarMySerialTimeTarget} > {{SerialTime} ;{{Goto WaitForMorning;

{{Label NotWithinNightBreak

{{'.. Macro commands which needs to run during daytime

{{'..

{{Goto Start

 

 

1.16.1.12     {{ImportFile, {{ImportSeparator, {{DoImport}, {{ImportNextLine}

 

(Additional commands: {{If, {{Goto, {{Label)

 

(Running example)

This example shows the use of import files.

 

Condition: The part ImportText needs to be copied to a file named ImportText.txt in directory C:\Temp. (Open Notepad and copy the 3 lines)

 

C:\Temp\ImportText.txt:

Zeile1_Teil1;Zeile1_Teil2;Zeile1_Teil3

Zeile2_Teil1;Zeile2_Teil2;Zeile2_Teil3;Zeile2_Teil4

Zeile3_Teil1;Zeile3_Teil2;Zeile3_Teil3

 

Makro:

{{ImportFile C:\Temp\ImportText.txt

{{ImportSeparator ;

{{Label Start

{{MessageBox {{DoImport}

{{MessageBox {{DoImport}

{{MessageBox {{DoImport}

{{MessageBox {{DoImport}

{{If {{ImportNextLine} = {{True};{{Goto Start;

 

 

Hints:

·         The {{1} in front of {{ImportFile is just necessary when loops are used. Here we use {{ImportNextLine} und {{Goto, so the {{1} is not necessary.

·         The forth {{DoImport} delivers an empty text for line 1 and 3... because there is nothing…

·         We need to define {{ImportSeparator ; because we do not use the standard separator (,).

 

 

1.16.1.13     {{ScanDirectories

 

(Additional commands: {{CreateDir, {{CopyFile, {{RenameFile, {{DeleteFile, {{WritelLineToFile, {{StartAndWait, {{ImportFile, {{ImportSeparator, {{MessageBox, {{MessageBox2)

 

(Running example)

This example shows the use of ScanDirectories. First two directories and files are created. The list of all the files is then shown in a Notepad window. Then files are copied and renamed and shown again. Finally the macro shows which parts ScanDirectories saves.

 

 

{{CreateDir C:\MTRTestDir77

{{CreateDir C:\MTRTestDir77\TestDir88

{{WriteLineToFile C:\MTRTestDir77\_This directory can be deleted.txt | This directory can be deleted.

{{WriteLineToFile C:\MTRTestDir77\TestFile.txt |This is a test file.

{{WriteLineToFile C:\MTRTestDir77\TestFileDelete.txt |This is a test file, which will be deleted soon.

{{WriteLineToFile C:\MTRTestDir77\TestDir88\TestFile2.Doc |This is a test file.

{{ScanDirectories C:\MTRTestDir77 | *.* | {{True} | {{MacroPath}DirList.txt | {{False}

{{WriteLineToFile  {{MacroPath}DirList.txt |{{CR}

{{WriteLineToFile  {{MacroPath}DirList.txt |This file contains all files in directory: C:\MTRTestDir77 (and subdirectories)

{{WriteLineToFile  {{MacroPath}DirList.txt |Please close this window to continue

{{StartAndWait {{MacroPath}DirList.txt

 

{{CopyFile C:\MTRTestDir77\TestFile.txt  | C:\MTRTestDir77\TestFileCopy.txt 

{{RenameFile C:\MTRTestDir77\TestFileDelete.txt | C:\MTRTestDir77\TestDir88\TestFileCopy2.txt  {{' This command moves the file and renames it.

{{DeleteFile C:\MTRTestDir77\TestFileDelete.txt

 

{{ScanDirectories C:\MTRTestDir77 | *.* | {{True} | {{MacroPath}DirList.txt | {{False}

{{WriteLineToFile  {{MacroPath}DirList.txt |{{CR}

{{WriteLineToFile  {{MacroPath}DirList.txt |This file contains also the copied/moved files of te directory C:\MTRTestDir77 (and subdirectories)

{{WriteLineToFile  {{MacroPath}DirList.txt |Please close this window to continue

{{StartAndWait {{MacroPath}DirList.txt

 

{{ScanDirectories C:\MTRTestDir77 | *.Doc | {{True} | {{MacroPath}DirList.txt | {{True}

{{ImportFile {{MacroPath}DirList.txt

{{ImportSeparator >

{{SetStringList Path, Filename and Extension: {{DoImport}{{CR}{{CR}

{{SetStringList {{StringList}Filename and Extension: {{DoImport}{{CR}{{CR}

{{SetStringList {{StringList}Filename: {{DoImport}{{CR}{{CR}

{{SetStringList {{StringList}Extension: {{DoImport}{{CR}{{CR}

{{SetStringList {{StringList}Path: {{DoImport}{{CR}{{CR}

 

{{MessageBox2 {{StringList}

 

{{ImportFile {{MacroPath}{{MKRFileName}

{{DeleteFile C:\MTRTestDir77\TestFile.txt

{{DeleteFile C:\MTRTestDir77\TestFileCopy.txt

{{DeleteFile C:\MTRTestDir77\TestDir88\TestFile2.Doc

{{DeleteFile C:\MTRTestDir77\TestDir88\TestFileCopy2.txt

{{DeleteFile {{MacroPath}DirList.txt

 

{{DeleteDir C:\MTRTestDir77\TestDir88

{{DeleteDir C:\MTRTestDir77

 

{{MessageBox Sometimes the directory C:\MTRTestDir77 will not be deleted. {{CR}In this case please delete it manually (Possibly you need to close the Recorder first).

 

Hints:

 

 

1.16.1.14     {{Gosub

 

(Additional commands: {{MessageBox, {{Goto, {{Label)

 

(Running example)

In this example message boxes show how the macro flows. You can see how the macro runs into the subroutine, comes back to the right location…

 

{{Gosub SubRoutine_1

{{MessageBox After calling SubRoutine_1

{{Gosub SubRoutine_2

{{MessageBox After calling SubRoutine_2

 

{{Goto Ende

{{Label SubRoutine_1

{{MessageBox In SubRoutine_1

{{Return

 

{{Label SubRoutine_2

{{MessageBox In SubRoutine_2

{{Return

 

{{Label Ende

{{MessageBox After Label Ende

 

 

1.16.1.15     {{Master

 

(Additional commands: {{MessageBox, {{SetGlobVar, {{MLoop)

 

(NOT running example. For being able to run the macro, Macro1 and Macro2 must exist)

 

{{Master

{{SetGlobVarCounter 1

{{LoadMacro C:\MyMacros\Macro1.krc

{{LoadMacro C:\MyMacros\Macro2.krc

{{MessageBox MLoop

 

Hints:

 

 

1.16.1.16     {{WaitForIEReady

 

(Additional commands: {{WindowKey, {{If, {{NoFocus)

 

(Running example)

This example opens the Internet page http://www.kratronic.com. Only if the page is downloaded fully, a Beep is played.

 

{{WindowsKey r

http://www.kratronic.com

{ENTER}

{{Delay 600} {{' Millisecounds

{{If {{WaitForIEReady 30} = {{True};;{{ShowError}

{{Beep

{{NoFocus}

 

Hints:

 

This command just works for Internet Explorer. For other browsers another technique needs to be used. Here an example for Chrome:

 

{{WindowsKey r

{{SetClipBoard åC:\Program Files (x86)\Google\Chrome\Application\chrome.exeå www.kratronic.com
^v
{ENTER}
{{Delay 1000} {{' Milliseconds
{{Label TryAgain
{{RelativeMouse Google Chrome, 1, 1, 26, 16, 0
{{If {{WaitForScreenChange 1,15,1} = {{True};{{Goto TryAgain;
{{MessageBox Internet page is loaded

 

It might be you need to adjust the mouse coordinates.

 

 

1.16.1.17     {{GetPixel

 

(Additional commands: {{MessageBox, {{RGB)

 

(Running example)

In this example the pixel colors of he coordinates 10,10 and 20,20 are shown.

 

{{Mouse  1, 1, 10, 10, 1

{{SetStringText Pixel at position 10,10:  {{GetPixel -1, -1} {{CR}

{{SetStringText {{StringText} Pixel at position 20,20:  {{GetPixel 20, 20}{{CR}

{{SetStringText {{StringText} RGB of 128,100,255: {{RGB 128,100,255}. 

 

{{MessageBox {{StringText}  

 

Hint:

·         {{Mouse  1, 1, 10, 10, 1: The 1 causes that the cursor is just placed and not clicked.

 

 

 

1.16.1.18     {{CheckWindow

 

(Additional commands: {{GetWindowPos, {{GetWindowName, {{GetCursorPos, {{MessageBox)

 

(Running example)

This example checks the existence of the Mouse and Key Recorder. Additionally the window coordinates and mouse coordinates are shown.

 

{{If {{CheckWindow #MKRX5#} = {{True} ;{{MessageBox MKR is existing;{{MessageBox MR is not existing

{{MessageBox Actual window name: {{GetWindowName}

{{GetWindowPos #MKRX5#

{{SetStringText MKR window position (Pixel){{CR}{{CR}

{{SetStringText {{StringText}Horizontally top left: {{VarGetWinCoord_X}{{CR}

{{SetStringText {{StringText}Vertically top left: {{VarGetWinCoord_Y}{{CR}

{{SetStringText {{StringText}Horizontally low right: {{VarGetWinCoord_X_End}{{CR}

{{SetStringText {{StringText}Vertically low right: {{VarGetWinCoord_Y_End}

{{MessageBox {{StringText}

 

{{RelativeMouse #MKRX5#, 1, 1, 25, 25, 1

 

{{GetCursorPos

{{SetStringText Cursor position (Pixel){{CR}{{CR}

{{SetStringText {{StringText}Horizontally : {{VarGetCursorCoord_X}{{CR}

{{SetStringText {{StringText}Vertically: {{VarGetCursorCoord_Y}{{CR}

{{MessageBox {{StringText}

 

 

HInts:

 

 

1.16.1.19     {{Sort

 

(Additional commands: {{SetVar, {{Var,{{IncVar, {{String, {{Goto, {{Label)

 

(Running example)

This example creates 10 random numbers between 1 to 5 and fills them into an array. Then the array is sorted and double numbers are removed. (Empty places get a zero)

 

{{SetVarCounter 1

{{Label Start

{{SetVarArray{{VarCounter} {{RandomNumber 1,5}

{{IncVarCounter 1

{{If {{VarCounter} <= 10 ;{{Goto Start;

 

{{Sort VAR, Array, 1, 10, {{True}

 

{{SetStringText Sorted numbers (Double numbers removed){{CR}{{CR}

{{SetStringText {{StringText} 1: {{VarArray1}{{CR}

{{SetStringText {{StringText} 2: {{VarArray2}{{CR}

{{SetStringText {{StringText} 3: {{VarArray3}{{CR}

{{SetStringText {{StringText} 4: {{VarArray4}{{CR}

{{SetStringText {{StringText} 5: {{VarArray5}{{CR}

{{SetStringText {{StringText} 6: {{VarArray6}{{CR}

{{SetStringText {{StringText} 7: {{VarArray7}{{CR}

{{SetStringText {{StringText} 8: {{VarArray8}{{CR}

{{SetStringText {{StringText} 9: {{VarArray9}{{CR}

{{SetStringText {{StringText} 10: {{VarArray10}{{CR}

{{' For filling of StringText we could of course also use Goto and Label..

{{' That would then look that way:

 

{{SetStringText Sorted numbers (Double numbers removed){{CR}{{CR}

{{SetVarCounter 1

{{Label Start2

{{SetStringText {{StringText} {{VarCounter}: {{VarArray{{VarCounter}}{{CR}

{{IncVarCounter 1

{{If {{VarCounter} <= 10 ;{{Goto Start2;

 

{{MessageBox {{StringText}

 

 

1.16.1.20     Mathematical commands

 

(Commands: {{IncVar, {{DecVar, {{MulVar, {{DivVar, {{Power {{Div, {{Mod)

 

(Running example)

This example uses all mathematical commands. (Exception: Commands in {{Calc )

 

{{SetVarExample 10.5

{{IncVarExample 2.7

{{MessageBox 10.5 + 2.7 = {{VarExample}

 

{{SetVarExample 10.5

{{DecVarExample 2.7

{{MessageBox 10.5 - 2.7 = {{VarExample}

 

{{SetVarExample 10.5

{{MulVarExample  3.5

{{MessageBox 10.5 * 3.5 = {{VarExample}

 

{{SetVarExample 10.5

{{DivVarExample 2.4

{{MessageBox 10.5  / 2.4 = {{VarExample}

 

{{SetVarExample {{Power 5 | 2}

{{MessageBox 5 power 2 = {{VarExample}

 

{{SetVarExample {{Div 10 | 3}

{{MessageBox 10 div 3 = {{VarExample} (Integer value of that division)

 

{{SetVarExample {{Mod 10 | 3}

{{MessageBox 10 mod 3 = {{VarExample} (Reminder of that division)

 

{{If {{IsNumeric 23f3} = {{True} ;{{MessageBox 23f3 is a number;{{MessageBox 23f3 is not a number

{{If {{IsNumeric 23e3} = {{True} ;{{MessageBox 23e3 is a number;{{MessageBox 23e3 is not a number

 

 

1.16.1.21     {{Text-Commands

 

(Commands: {{Len, {{InStr, {{Mid, {{Left, {{Right, {{Ucase, {{Lcase, {{Asc, {{Chr, {{Replace)

 

(Running example)

This example uses all text commands.

 

{{SetVarLen {{Len Mouse and Key Recorder}

{{MessageBox 'Mouse and Key Recorder' has {{VarLen} characters

 

{{SetVarLen {{InStr 1 | Mouse and Key Recorder | Key}

{{MessageBox In the text 'Mouse and Key Recorder' the word 'Key' starts at: {{VarLen}

 

{{SetStringText {{Mid Mouse and Key Recorder | 7 | 3}

{{MessageBox Within 'Mouse and Key Recorder'  the word at location 7 (3 characters long) is: {{StringText}

 

{{SetStringText {{Left Mouse and Key Recorder | 5 }

{{MessageBox Within 'Mouse and Key Recorder' the first 5 characters are: {{StringText}

 

{{SetStringText {{Right Mouse and Key Recorder | 8 }

{{MessageBox Within 'Mouse and Key Recorder' the last 8 characters are: {{StringText}

 

{{SetStringText {{Ucase Mouse and Key Recorder}

{{MessageBox 'Mouse and Key Recorder' in capital letters: {{StringText}

 

{{SetStringText {{Lcase Mouse and Key Recorder}

{{MessageBox 'Mouse and Key Recorder' in small letters: {{StringText}

 

{{MessageBox The ASCII value of character: 'M' is: {{Asc M}

{{MessageBox Der character of the ASCII vale: 80 is: {{Chr 80}

 

{{SetStringText {{Replace Mouse and Key Recorder | Key | Keyboard | 1 | -1} 

{{MessageBox If you replace Key with Keyboard you get: {{StringText}

 

 

1.16.2     OR functionality ||

 

(Running example)

This example shows how to use the OR functionality (||). The macro shows all numbers between 1 and 30 which can be devided by 2 or by 3

 

{{Start Notepad

{{Delay 500

Numbers which can be devided by 2 or by 3 (1-30)

{ENTER 2}

{{SetVarCounter} 0

 

{{Label Start

{{IncVarCounter} 1

{{If {{Mod {{VArCounter} | 2} = 0;{{SetVarEven {{True};{{SetVarEven {{False}

{{If {{Mod {{VArCounter} | 3} = 0;{{SetVarThree {{True};{{SetVarThree {{False}

{{If {{VarEven} || {{VarThree} ;;{{Goto NotARequiredNumber

{{Switch Editor

{{VarCounter}

{ENTER}

{{Label NotARequiredNumber

{{If {{VarCounter} < 30;{{Goto Start;

 

 

 

1.16.3     Examples for solving general tasks

 

1.16.3.1     Example for repeating the whole macro or parts of it

 

(Running example)

This technique allows repeating macros or parts of macros without the Loop-function. In this example the commands … are repeated 10 times.

 

{{SetVarCounter 0

{{Label Start

{{IncVarCounter 1

{{MessageBox We are in loop: {{VarCounter}

{{'....

{{'....

{{If {{VarCounter} < 10 ;{{Goto Start;

 

 

1.16.3.2     {{If command with several commands for 'then' and 'else'

 

(Running example)

An {{if command in earlier versions of the Recorder could only hold one command for the then-part and one command for the else-part. The above example shows a way for several commands for each part.

…..

{{SetString1 ok

{{If {{String1} = ok ;;{{Goto Else

{{MessageBox Then Command 1

{{MessageBox Then Command 2

{{MessageBox Then Command 3

{{Goto EndElse

{{Label Else

{{MessageBox Else Command 1

{{MessageBox Else Command 2

{{MessageBox Else Command 3

{{Label EndElse

 

{{SetString1 not-ok

{{If {{String1} = ok ;;{{Goto Else2

{{MessageBox Then Command 1

{{MessageBox Then Command 2

{{MessageBox Then Command 3

{{Goto EndElse2

{{Label Else2

{{MessageBox Else Command 1

{{MessageBox Else Command 2

{{MessageBox Else Command 3

{{Label EndElse2

 

Since V7.0 this is can be achieved easier:

 

{{SetString1 ok

{{If {{String1} = ok ;{{MessageBox Then Befehl 1§{{MessageBox Then Befehl 2§{{MessageBox Then Befehl 3;{{MessageBox Else Befehl 1§{{MessageBox Else Befehl 2§{{MessageBox Else Befehl 3

{{SetString1 not-ok

{{If {{String1} = ok ;{{MessageBox Then Befehl 1§{{MessageBox Then Befehl 2§{{MessageBox Then Befehl 3;{{MessageBox Else Befehl 1§{{MessageBox Else Befehl 2§{{MessageBox Else Befehl 3

 

 

1.16.3.3     Waiting for the download of an Internet page by Firefox

 

(Running example)

Here we wait for the color change of the stop button. As soon as the button becomes grey the page download is finished.

 

{{Switch Mozilla Firefox

% {{'' Don't remove this space. Necessary for maximizing

x {{' Maximize window (to have the stop button always on the same location)

{{' That way we can keep the search range of {{FindPattern small

^l {{' Open Address field

www.kratronic.com

{ENTER}

{{Label WaitAgain

{{Delay 300} {{' Milliseconds

{{Mouse 1, 1,  135, 61, 1

{{If {{FindPattern 1, -1, -1, 200, 200, 0} = {{True};;{{Goto WaitAgain

Hint: This macro needs also a pattern (15x15 Pixel) of the gray stop button. This needs to be recorded on the own PC.

The macro maximizes FireFox and starts the requested page. Then the macro waits until the start button turns gray. Then the macro continues.

 

1.16.3.4     Waiting for the download of an Internet page by Internet Explorer

 

With Windows 8.1 the function {{WaitForIEReady has become unreliable (Windows shortage). A similar approach as above for Firefox can also be used for IE.

 

 

During downloading the page, a rotating circle is shown. To make sure we find the correct tab we first search for the x in the white (active) tab by {{FindPattern. During recording the pattern the options: "Reading Cursor Offset" and "Two step cursor" needs to be activated. That way we can locate the cursor to the center of the rotating circle. After that we wait until the circle stops rotating by {{WaitForScreenChange. The whole script is then covered into a Gosub routine. That way we can call the function with only one line of code.

 

{{Gosub WaitForBrowser {{' Calling routine

{{Goto Ende

 

{{Label WaitForBrowser

{{Switch Internet Explorer

{{GetCursorPos}  {{' Needed to place the cursor to the location it had before

{{If {{FindPattern 1,  715,  31, 1200, 400, 0} = {{True};;{{ShowError}

{{IncVarFindPatternCoord_X_1} -170

{{IncVarFindPatternCoord_Y_1} 7

{{Mouse  1, 1, {{VarFindPatternCoord_X_1}, {{VarFindPatternCoord_Y_1}, 1

{{Label Again

{{If {{WaitForScreenChange 1,15,1} = {{True};{{Goto Again;

{{Mouse  1, 1, {{VarGetCursorCoord_X}, {{VarGetCursorCoord_Y}, 1

{{Return

{{Label Ende

 

Important: The blue lines needs to be generated on the target PC. (Just copying the macro is not sufficient)

 

 

1.16.3.5     RandomString using self defined characters

 

(Running example)

The command {{RandomString cannot deliver all combinations, e.g. all characters from a to z and numbers from 0 to 9. The following macro allows this:

 

{{SetGenDelay 0

{{SetStringCharacters abcdefghijklmnopqrstuvwxyz1234567890 {{' possible characters (36 pieces)

{{SetVarAllCharacters {{Len {{StringCharacters}} {{' Number of characters

 

{{SetStringRandomChars #emptyX5#

{{SetVarNoOfChars 10 {{' Needed number of random characters

{{SetVarCounter 0

{{Label Start

{{IncVarCounter 1

{{Gosub GetOneChar

{{SetStringRandomChars {{StringRandomChars}{{StringChar}

{{If {{VarCounter} < {{VarNoOfChars} ;{{Goto Start;

{{MessageBox {{StringRandomChars} {{' Showing the random numbers

{{Goto Ende

 

{{Label GetOneChar

{{SetStringChar {{Mid {{StringCharacters} | {{RandomNumber 1,{{VarAllCharacters}} | 1}

{{Return

 

{{Label Ende

 

 

1.16.3.6     Using several Hotkey Sets

 

Hotkeys are saved in a file. That means there is just one set of hotkeys for the Recorder. But.. a trick allows to build several hotkey sets.

Hotkeys are saved in the file {{AppDataPath}\MacroHotKeys.txt. To find the file on your PC simply carry out the following command: {{MessageBox {{AppDataPath}. Now you save a changed hotkey file to MacroHotKeys1.txt.

The following macro allows switching between the different hotkey files:

 

{{CopyFile {{AppDataPath}\MacroHotKeys.txt | {{AppDataPath}\MacroHotKeysOriginal.txt

{{CopyFile {{AppDataPath}\MacroHotKeys1.txt | {{AppDataPath}\MacroHotKeys.txt

{{ReadHotKeys}

 

{{ReadHotKeys} is necessary to read in the changed hotkeys.

 

Hint: Hotkeys do not work when Internet Explorer has the focus. (Microsoft restriction against phishing)

 

 

1.16.3.7     Restarting PC regularly

 

Some users use the Recorder for long term tasks (example a watchdog for a server functionality on a client). Sometimes client programs used very intensively tend to consume memory and tend to crash after a while. This can be avoided by restarting the PC regularly. The following example restarts the PC twice a day (at 11:00 and 23:00)

 

{{SetVarNoOfTimes 2

{{SetVarFlagBeforeMidnight {{False}

{{SetStringTime1 {{CreateSerialTime 1970,1,1,11,00,00}

{{SetStringTime2 {{CreateSerialTime 1970,1,1,23,00,00}

 

{{SetStringMyTime {{Replace {{Time} | - | , | 1 | -1}

{{SetVarMySerialTime {{CreateSerialTime 1970,1,1,{{StringMyTime}}

{{If {{VarMySerialTime} < {{StringTime1} ;{{SetVarShutDownCounter 1§{{Goto EndSettings;

{{If {{VarMySerialTime} < {{StringTime2} ;{{SetVarShutDownCounter 2§{{Goto EndSettings;

{{If {{VarMySerialTime} >= {{StringTime{{VarNoOfTimes}} ;{{SetVarFlagBeforeMidnight {{True};

{{Label EndSettings

 

{{Label Start

 

{{' ................. Here your tasks are located.

 

 

{{' Restart PC (cleaning up memory leaks and so)

 

{{SetVarMySerialTimeOld {{VarMySerialTime}

{{SetStringMyTime {{Replace {{Time} | - | , | 1 | -1}

{{SetVarMySerialTime {{CreateSerialTime 1970,1,1,{{StringMyTime}}

{{If {{VarMySerialTime} < {{VarMySerialTimeOld} ;{{SetVarFlagBeforeMidnight {{False}§{{SetVarShutDownCounter 1;

{{If {{VarFlagBeforeMidnight} = {{True} ;{{Goto Start;

{{If {{VarMySerialTime} < {{StringTime{{VarShutDownCounter}} ;{{Goto Start;

{{If {{VarShutDownCounter} = {{VarNoOfTimes} ;{{SetVarFlagBeforeMidnight {{True};

{{IncVarShutDownCounter 1

{{WriteLineToFile C:\Temp\LMSLiveCheck.txt |=> LMS PC-Restart: {{Datetime}

{{DOS shutdown -r -f

{{ExtDelay 1:00

{{Goto Start

 

Hints:

For this macro the PC needs to be set that way that it starts without asking for a PC login. You can use automated login by using the tool: "ALO". This small tool can be found at: www.kratronic.com/tools/recorder/sw/ALO.exe. Also the Mouse and Key Recorder macro needs to start automatically. That means you need to add a shortcut to this macro in the Autostart folder.

 

 

 

--------------------------------------------------------------------------------------------------------------------

 

1.16.3.8     Further examples

 

During the installation the file "RecTest.zip" was installed to the directory you have chosen for the 'Mouse and Key Recorder'. You can extract the files in RecTest.zip archive to the directory C:\RecTest. The macros you find there have been used to test some aspects of the 'Mouse and Key Recorder'. The macros are written that way that they should work on all Operation Systems and all languages. Simply start the macro: "RTestMaster.krc". If you have extracted the files to C:\RecTest then all macros should be called automatically. Hint: The macros do not work if you have changed the default quotation mark character (å).

 

You can find another small example when you click ‘?' and there ‘Open Sample Macro'.

 

Additional examples can be found on the Internet page: http://www.kratronic.com/tools/recorder/faq/faq.htm

 

 

1.17     Hints / Limitations

 

·         In version V7.0 and higher the switch for the macro hotkeys and other hotkeys like Stop, Pause, etc. is combined. Activating this switch has a small side effect. The special keys like ^ and ¨ (on Swiss keyboard) act differently (^ ¨ are combination keys. They can be used to crate e.g â, by pressing first ^ and then a). If the macro hotkeys are activated (and the Recorder runs) then at each keystroke two characters are entered e.g. ^^, ¨¨. If this needs to be avoided, this switch has to be deactivated or the Recorder has to be closed. Also during macro run this switch has an effect to those characters.

·         The command {{Calc has changed in V7.0. Some commands have been added; others have been removed or changed. In case such commands are used in the macros, they need to be adapted.

·         The command {{FindPattern has been improved in version 6.7. The pattern search is about seven times faster than before. Additionally Aero Glass mode can now be active during FindPattern.

·         The command {{WaitForScreenChange has also been improved in V6.7. Here also Aero Glass mode can be active while running this command.

·         The command ReplaceBraces.exe has been replaced in version 6.7 by {{BracesReplace. If you have used this command please change it to the new one.

·         Windows Vista/Win7: In Windows Vista and Windows 7 several changes have been made, which have an influence on the Mouse and Key Recorder:
- In Windows Vista and Windows 7 programs and web forms sometimes have problems with the Recorder's normal text entry  (characters or whole words are left out). In this case the instruction {{SendTextSpecial} helps.
- In Windows Vista/Win7 it is no longer possible recording key strokes and mouse clicks in a browser (e.g. Internet Explorer). (Reason: Microsoft’s measures against viruses and Trojan horses which want to do password pishing). To be able recording mouse clicks anyway, the menu: 'Insert' / 'mouse entry' was added. For entering key strokes change to another window e.g. Notepad, or enter the text in the Recorder edit window.
- The above restriction (no recording in IE7) also affects the hotkeys (Hotkeys work the same way as recording key strokes). That means in Windows Vista / Win7 hotkeys can not be used in the browser.

·         The command {{SendTextSpecial} switches to another Output Mode. In this mode keystrokes are sent without delays (without waiting until the application has processed the key). Side effect: After a ^c a sufficient delay is necessary before accessing the clipboard, otherwise the old clipboard value is delivered…

·         UltraVNC can cause problems with the {{Switch command.

·         The Mouse and Key Recorder checks the syntax of every line. If it finds an error it shows a syntax error. In certain situations if there are more than one error in a line the recorder can crash. (Runtime error). If this is the case, please check the debug-log-file. There you find the last correct line.

·         Comparing or using text copied from Excel cells is a little bit tricky. A text copied from an Excel cell to the clipboard contains always a carriage return and a line feed at the end of the text. That means your {{If statement needs to look the following way: {{If {{ClipBoard} = TEXT{{CR}{{LF};OK-Action;False-Action
To get rid of the surplus cr lf you can use the following code:
{{Switch Microsoft Excel
^c
{{Delay 300} {{' Milliseconds
{{SetVarLen {{Len {{ClipBoard}}
{{DecVarLen 2}
{{SetStringExcel {{Trim {{Left {{ClipBoard} | {{VarLen}}}
Hint: The newer Office (e.g. Office 2003) sometimes adds some spaces to the text in the cells. To get rid of them you can use the command {{Trim

·         In some cases the reactions to 'Mouse and Key Recorder' macros are not the same as you get when you carry out the actions manually. Reason for theses "misbehaviors" are specialties in certain applications. Often theses applications use "dirty tricks" to do certain tasks. If you come across such a behavior, you should try to find another way to do the task.

·         'Mouse and Key Recorder' does not work in DOS-Boxes when using Normal-Text-Mode. Use {{SendTextSpecial} for DOS-Boxes..

·         Some applications react quite strange to right mouse button clicks. The following applications produce 3 to 6 clicks for one right mouse button click: Older versions of Microsoft Word, Excel, PowerPoint. If you need to use the right button for those applications, you should delete the surplus clicks by using the Recorder editor.

·         The Notepad.exe program has a strange behavior. When you close it from the Recorder by using ALT F4, not only Notepad is closed, but also the Recorder ! (This does not happen if you have more than one Notepad open.) Solution: Use File | Exit to close a Notepad.

·         All examples in this manual show a closing ‘}’ after output commands like {{Var1}. This closing ‘}’ is absolutely necessary when the commands are used as parameters. Example: {{SetVar1} {{Loop}. Here Loop must have a ‘}’. If you use {{Loop} at the beginning of a line you can omit ‘}’ Examples:
{{Loop
{{SetVar1 {{Loop}

·         Important: Commands not used as parameters and containing text must not close with a bracket. Examples:
{{SetString1} MyText  
{{Switch Document2 Microsoft Word

·         Global variables are not stored in the RAM but they are stored in one file for all macros. That means your global variable file becomes larger over time. That way your macros could be slowed down. If you use lots of global variables, you should from time to time delete the global macro file. (Or some of the content) You can find this file (Global4107Kra.var) by using the search function. Unfortunately the Windows search function can not find such local files :-( A good alternative to the anyway not satisfying Windows search is the program: "Effective File Search" http://www.sowsoft.com/search.htm  Another way finding this file is using the command: {{MessageBox {{AppDataPath}

·         Macros recorded in one screen resolution or on a specific operating system may not run properly by using other screen resolutions or operating systems. This restriction is not valid if no mouse and focus commands have been used in the macros.

 

 

1.18     Installation

 

The 'Mouse and Key Recorder' is stored as *.ZIP file. This ZIP file needs first to be extracted. Modern Operating Systems as Windows XP or newer can automatically extract ZIP files.

After downloading and extracting 'MouseAndKeyRec.ZIP' simply start the file: Setup.EXE. The installations program will lead you through the installation process. Important: For installation administrator rights are necessary.

Depending of the operating system the installation asks for installing .NET Framework 2. Just click yes to install the Framework over Internet.

 

If the 'Mouse and Key Recorder' was installed by another user, there is possibly no Recorder icon in the Start menu. In this case please create an icon manually by clicking with the right mouse button on the program: C:\Program Files\KraTronic\Recorder\Recorder.exe and then choosing 'Create Shortcut'. After that, copy the new shortcut to your desktop. (You can use the Windows Find function to find the program 'Recorder.exe')

 

Virus scanners:

Some virus scanners block the installing of new programs. If this is the case you need to deactivate your virus scanner during Recorder installing. You can of course reactivate the virus scanner after the installing.

 

 

 

1.18.1     PC independent installation

 

If you want to use the Mouse and Key Recorder without installing it on your PC you might consider using MojoPac or Prayaya V3 (http://en.prayaya.com/index.html) That way you can use the Recorder on e.g. a memory stick.

 

1.19     Upgrade Installation

 

It is recommended to un-install an existing 'Mouse and Key Recorder' if you want to upgrade it to a higher version. Procedure: Click Start, Settings, Control Panel, Add/Remove Programs (or 'Software' or 'Program and Features' for some operating systems). Choose 'Recorder' and click 'Add/Remove/Edit' or 'Edit or uninstall'. If you have worked just before un-install with the Mouse and Key Recorder then it is recommended to reboot after uninstalling.

 

Hints: Your macros and Recorder settings will not be deleted by a un-installation or a re-installation.

Important: The language files will be replaced. If you have changed a language file you need to redo the changes after the upgrade. (If you send the corrections to me, I will include them to the installation.)

 

 

1.20     Upgrade Information

 

Version 7.0 was developed on VB.Net 2005. (Earlier versions on VB 6.0). This caused some changes in the Recorder behavior. If you have used already older versions, you might look at the delta document to find all changes. See FAQ for a link.

 

Version V6.5 (or higher) does not any longer support variable files created with V5.3 or lower. If a macro is accompanied by such an old .VAR file, it will be deleted. Before deleting a backup file is created (with the ending: _backup). Usually deleting the .VAR file does not affect the macro in any way. Only if variables need to keep the value for the next start of the macro (e.g. counters), these values need to be set again. Reason for this change was an improvement of the Mouse and Key Recorder. The recorder now works with variables in the RAM and just saves them at the end of the macro. That way the macro can run faster and the sometimes appearing error: Var file could not be deleted/renamed cannot any longer happen.

 

With V5.4 (and higher) it is not any longer possible to switch to the Mouse and Key Recorder by using the command {{Switch. If you want to activate the Mouse and Key Recorder you need to use the symbolic name: #MKRX5#. Example: {{Switch #MKRX5#. This symbolic name can also be used with {{SwitchOrStart and {{CheckWindow.

 

Version V5.3 (and lower) had a small error in the part of saving text and value variables. Variable names were stored case sensitive, but read not case sensitive. The consequence was that e.g. "varPeter" and "varpeter" was saved twice. During reading the variable always the first (saved) variable was used.

The changed, correct way of saving variable names can just be used for new macros. (Otherwise even more double entries would be created). Do you want to have a correct saving also in old macros you need to delete the VAR-Files. Warning: If you use variables which act as counters during multiple use of a macro these "counters" will be resetted. (e.g. a variable, which is used for naming a file differently each time the macro runs). Procedure: Menu: File | Open, then set file type to "All Files" and delete all files with the extension .VAR. After closing the Open-Window, enter the following command to the Macro Code Window: {{Start Explorer {{AppDataPath}. Let the macro run and delete the two files with an extension .VAR in the appearing window. (Temporary and Global)

 

Version 5.0 does not any longer support variables without numbers e.g. {{Var}. If you have used such variables you need to add a number or a name. E.g.  {{Var1} or {{VarMyNumber}

 

 

 

1.21     Disclaimer

 

The 'Mouse and Key Recorder' has been tested to the best of our abilities for bugs. The author of 'Mouse and Key Recorder' is not responsible for any damage that may incur to the user's system or data as a result of using 'Mouse and Key Recorder'.

 

John Krauer, Kra-Tronic Corp.   02. January 2013