FAQ - Content

Inhalt

1     Recording mouse-clicks not working always after Windows 10 Creators Update. 2

2     Modifiers (ALT, SHIFT, CTRL) do not work anymore. 2

3     Mouse clicks are recorded incorrectly. 3

4     Mouse commands in old macros click at wrong places. 3

5     Special characters are given out differently. 3

6     Recording of keystrokes and mouse clicks not any longer possible. 4

7     Hints for using the Recorder with Windows Vista, Windows 7 and Windows 8.x. 4

8     Problems with MS Internet Explorer 7 (IE7) and higher 5

9     Does the Recorder contain adware, spyware, Trojans or viruses?. 5

10    SAP does not accept the keystrokes. 6

11    My HotKeys do not work. 6

12    The E-Mails sent to Kra-Tronic are coming back. 6

13    Is there a site for example macros ?. 7

14    How do I install the Mouse and Key Recorder ?. 7

15    One of my macros runs unreliable. 8

16    {{Switch does not find my modal window.. 8

17    {{Switch minimizes my target window.. 9

18    How to use {{WaitForFocus. 9

19    Mouse clicks do not click any more during replay. 10

20    How to compare text from Excel cells ?. 10

21    How to use tab as a separator in import files. 11

22    Mouse clicks containing a coma in the win. name do not work. 11

23    {{String2} in the middle of the line is not working. 11

24    {{Loop is not working. 12

25    Macro Abort is often difficult 12

26    How to interact with a macro. 12

27    Infinite Loop. 13

28    Cannot paste to certain windows. 13

29    Switching to windows with a space in the name. 13

30    Hiding / Closing the Mouse and Key Recorder 14

31    Changing names in windows titles. 14

32    Mouse and Key Recorder as DLL. 14

33    How to create a Mouse and Key Recorder icon ?. 15

34    Random DoImport 15

35    Sample Macros. 16

35.1    Waiting for a text change in an Internet browser.. 16

35.2    Randomize a list of names.. 16

35.3    Setting a Hotkey by macro.. 17

35.4    Changing Time format. 17

35.5    Catching a screenshot all 5 minutes.. 17

35.6    Creating random numbers for lottery.. 18

35.7    MP3 Randomizer.. 19

35.8    MP3 Pre-Number remover.. 20

35.9    Cleaning (overwriting) Hard disk.. 21

 

 

 

 

1         Recording mouse-clicks not working always after Windows 10 Creators Update.

 

Question:

After the last Windows update (Creators Update April 2917) mouse click recording does not work reliably. After starting the Recorder recording is ok, but after a run of the recorded macro, mouse recording does not work anymore.

 

Answer:

Microsoft changed some parameters in the Creators Update, causing the above problems.

 

Workaround: By switching off hotkeys during recording this problem disappears. (Menu: Tools / Options /  [Tab General] / "HotKeys activated")

 

Solution: This problem is solved in Recorder Version V8.0 and newer.

 

2         Modifiers (ALT, SHIFT, CTRL) do not work anymore.

 

Question:

Recently some commands (containing modifiers) do not work any longer correctly. What can I do ?

 

Answer:

Microsoft released some update (patches) in December 2015, which affects certain Recorder functions.

Two effects can be seen:

 

1) Version V7.5 and V7.6 use as default setting: {{SendTextSpecial}. On some PCs this causes modifier-problems. E.g. using +{LEFT} moves the curser left, but without Shift (+).

Solutions: Add the command {{SendTextNormal} at the top of the macro.

Use version V7.7 or newer. This version uses {{SendTextNormal as standard setting.

 

2)  If a macro is started with a hotkey then on some PCs the modifier (ALT, SHIFT, CTRL) is not resetted correctly. As a result commands like CTRL c (^c) do not work anymore.

Solutions: For Recorder V7.5 and V7.6 add {{SendTextNormal} at the top of the macro.

Use version V7.7 or newer. This version uses {{SendTextNormal as standard.

 

3         Mouse clicks are recorded incorrectly.

 

Question:

Recently, (or since upgrading to Windows 10) mouse click recording does not work properly (Wrong coordinates are stored).

 

Answer:

Recorder V7.4 (or older) has an error. If in Windows 8 / 8.1 or Windows 10, the text size (scaling level) is set to a value other than 100%, mouse clicks are recorded incorrectly. In version 7.5 and newer this error is corrected.

Alternative: Adding mouse clicks by using F6 (mouse input), works well even with another zoom ratio than 100%

 

The problem with a changed font size occurs on Windows 10 more often because Windows 10 changes the scaling level automatically when run on a PC with small screens and high resolution.

 

 

4         Mouse commands in old macros click at wrong places. 

 

Question:

Recently, (or since upgrading to Windows 10) mouse clicks are not working properly anymore. Mouse clicks within old macros (e.g. used for Windows 7) are clicking on wrong locations.

 

Answer:

If in Windows 8 / 8.1 or Windows 10, the text size (scaling level) is changed to another value, mouse clicks are given out incorrectly. (To wrong locations)

In principle, changing the text size (scaling level) is problematic for mouse clicks. Because of the larger windows, the click targets are at a different locations. That means, if you change the zoom factor, you have to revise mouse clicks, (recording them new).

 

The problem with a changed text size occurs on Windows 10 more often because Windows 10 changes the scaling level automatically when run on a PC with small screens and high resolution (e.g. to 125%).

 Because Windows 10 has partly changed windows (frames, menus), even with not changed scaling level, mouse clicks can go to wrong locations. In this case the clicks need to be re-recorded.

 

5         Special characters are given out differently

 

Question:

After updating Mouse and Key Recorder to V7.5 or V7.6 some special characters are outputted differently. How can I correct this ?

 

Answer:

With V7.5 the default for text output has changed from {{SendTextNormal to {{SendTextSpecial. In case this causes problems in older macros, the command {{SendTextNormal can be added to the macro to switch back to the previous behavior.

 

 

6         Recording of keystrokes and mouse clicks not any longer possible

 

Question:

After updating to V7.0 or higher recording of keystrokes and mouse clicks does not work any longer. How can I correct this ?

 

Answer:

Since V7.0 Hotkeys and recording are combined. That means hotkeys must be activated. This can be done here: Tools / Options / Tab: General: "Hotkeys activated"

 

 

7         Hints for using the Recorder with Windows Vista, Windows 7 and Windows 8.x

 

Question:

Does the Mouse and Key Recorder also work with Windows Vista, Windows  7 and Windows 8?

 

Answer:

Basically the Mouse and Key Recorder works with Windows Vista / Windows 7 / Windows 8 but…

 

Microsoft changed different things, which affect the macros in the Mouse and Key Recorder.

 

Reading pixels has become extremely slow in Vista / Windows 7 when using the new function "Windows Aero". That means that the commands {{WaitForScreenChange and {{FindPattern are virtually useless with Windows Aero.

Solution: Using Version V6.7 or Version V7.2 or higher. In these versions these commands work also in Aero Glass Mode.

   

Other effects:

Windows Vista / 7 / 8  got some new forms e.g. File selection. Therefore the old workflows used in Windows XP sometimes do not work any longer. They need to be adapted to the new workflow.

There are even forms which do not have the focus after the open. Then a mouse click needs to be inserted into the macro.

 

In Windows Vista / 7 / 8  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 phishing). 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.

Another side effect of this restriction is, that the pause/stop hotkeys do not work if the focus is on the browser.

 

The Clipboard works slower in Windows Vista / 7  / 8. Therefore after a ^c (CTRL C) a delay (e.g. 100 ms) is often necessary before a command like {{SetVar1 {{ClipBoard} can be used. Without the delay often the old clipboard value is used. In version V6.1 (and later) a small delay is already built in, that means with this and following versions the problem should not appear.

 

 

8         Problems with MS Internet Explorer 7 (IE7) and higher

 

Question:

Windows update installed automatically IE7 on my PC. Since then I have problems with some macros. What can I do ?

 

Answer:

Microsoft’s new browser causes some new problems. Here a list of the problems and possible workarounds:

  • The new IE7 (and newer) has another title: Windows Internet Explorer instead of Microsoft Internet Explorer. That means {{Switch and {{RelativeMouse commands for IE7 do not work any longer.
    - You need to change the Window name in the macros. For new recordings you can change the Rel Window Filter.
  • The new IE7 (and newer) uses the function: ‘Clear Type’ This function changes the look of characters. That way Commands like {{GetPixel or {{FindPattern do not work properly again.
    - You need to define the pixels or the recorded patterns new.
  • Some text fields are acting very strange in IE7 (and newer). When entering a text the first characters are ‘forgotten’ (are not written).
    - You can use {{SetClipboard and then CTRL v for entering text. Sometimes this helps. You can also try the new text mode: {{SedTextSpecial. (Please consult the help for restrictions)

 

 

9         Does the Recorder contain adware, spyware, Trojans or viruses?

 

Question:

My virus-scanner tells the Mouse and Key Recorder contains Trojans. Does the Mouse and Key Recorder Installation also install other programs?

 

Answer:

Some virus scanners identify the recorder incorrectly as spyware or Trojan horse. The reason for that is, that the recorder uses for recording the keystrokes the same components as many key-loggers.

We promise: The Mouse and Key Recorder installation will never contain anything else than the pure Mouse and Key Recorder.

 

  

10    SAP does not accept the keystrokes

 

Question:

I'm trying to send text into SAP-Fields but had no luck. SAP don't show me characters sent via recorder...

 

Answer:

SAP seems to use very special techniques for their Graphical-User-Interface (GUI). The Mouse and Key Recorder puts its keystrokes into a message pipe. If an application catches the keystrokes already at keyboard buffer location it will not get the keystrokes. (Reading the buffer is a very uncommon and not recommended way of catching keystrokes.)

You can try the following trick:

Copy your text to the clipboard and put it to your SAP window by CTRL v.

 

{{Mouse 1, 1, 59, 352, 0

{{SetClipbaord MyText

^v

 

This might work, depending where SAP is catching CTRL v.

 

You can also try the function: {{SendTextSpecial}

 

 

11    My HotKeys do not work

 

Question:

I have defined some hotkeys (CTRL ALT SHIFT a, b c…) and I have activated: 'Use Macro Hotkeys'. But, what I ever try the hotkeys do not work. What is wrong ?

 

Answer:

It is important you have switched off 'Caps Lock'.

When you define a hotkey e.g. CTRL ALT SHIFT a, and you press CTRL ALT SHIFT a, and 'Caps Lock' is on, then this macro is not started.

 

 

12    The E-Mails sent to Kra-Tronic are coming back

 

Question:

I tried to contact Kra-Tronic Corp. by E-Mail. But my E-Mails come back with the comment: Invalid address. Why that ?

 

Answer:

The reason for this problem is spam.... I need to have e-mail addresses on the web. Spammers harvest these addresses and send me all their rubbish. Without any action I get about 50 spam mails a day.... So I regularly change my e-mail addresses on the web (as soon as a spammer has harvested one). That means you always have to use the newest address you find in my homepage... To make sure you get the real newest address press F5 (reload) before you use the e-mail address.
 

  

13    Is there a site for example macros ?

 

Question:

Lots of people are writing Mouse and Key Recorder macros. It would be nice if there were a site for example macros. That way the 'wheel' has not to be invented by everyone again.

 

Answer:

You can find sample macros in the Help.. There are also some sample macros to the end of the FAQ page. If you have written a cool macro of common interest please send it to me. The e-mail address you can find in:

www.kratronic.com/tools/recorder

 

I will add the macros to this page.

 

Keep in mind: 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.

 

 

14    How do I install the Mouse and Key Recorder ?

 

Question:

I have downloaded the Mouse and Key Recorder. What do I have to do with the downloaded 'MouseAndKeyRec.ZIP' file ?

 

Answer:

The Mouse and Key Recorder is stored as *.ZIP file. (MouseAndKeyRec.ZIP) This ZIP file needs first to be extracted. For Windows XP you can find a good ZIP Tool at:

http://www.winzip.com. Newer operation systems support ZIP files natively.

 

After downloading and extracting 'MouseAndKeyRec.ZIP' simply start the file: Setup.EXE.

Before you re-install the ‘Mouse and Key Recorder’ or before you upgrade it to a higher version you should de-install the old ‘Mouse and Key Recorder’.

Procedure: (Right-)Click Start, Settings, Control Panel, Add/Remove Program and choose Recorder in the white field. Then click Add/Remove.

Hints: Your macros will not be deleted by the de-installation.

 

 

15    One of my macros runs unreliable

 

Question:

I have recorded a macro. This macro sometimes runs well, sometimes it makes wrong things. What can I do ?

 

Answer:

The reliability of a macro depends on various things.

Speed: Without any change a macro runs at near maximal speed. This is much faster than the fastest human user. As long as just keystrokes are used, the Mouse and Key Recorder waits for the execution of each keystroke. If you use mouse clicks and commands, the Recorder speed can be faster than the PCs reaction. That way clicks might be missed and the macro gets 'out of sync'. An easy way to mend this is to use a large Line Delay. But that way the whole macro becomes slow. The better way is to include {{Delay commands at the right locations.

Screen-Situation: When you record a macro a certain situation is present on your screen (some windows are open, Buttons are at certain locations…). To have a reliable macro it is recommended to test the necessary preconditions in your macro. Examples:

  • Test if a window exists. (if not, then start the application)
  • Maximize a window (to be sure to click on the right location)
  • Test existence of an import file
  • Use one of the {{WaitFor… Commands to wait for certain situations (just using a {{Delay is not so good… If the situation occurs too late, your macro is again 'out of sync')

 

For even more hints see the chapter 'Working with the Mouse and Key Recorder / Important Hints' in the Mouse and Key Recorder help.

 

 

16    {{Switch does not find my modal window

 

Question:

I updated to V5.0. Now one of my {{Switch command does not find a modal window any more. What can I do ?

 

Answer:

The Mouse and Key Recorder V5.0 and later uses new kinds of switching command. The old command often did not find windows if not the whole name was delivered.

So we built in a new command. But switching is a tricky business… During the search for windows we filter out all windows in the tool window (small icons in the right lower corner) and all not visible windows. Modal windows often are not visible when you use ALT TAB. Therefore they often cannot be found. We could remove the above filters, but then too many windows would be found and if the part you are looking for is not a visible window, you would think, the command does not work at all. In a normal situation when you have 5 windows open there are in reality 34 windows present…

What can you do?

V5.0 and higher contains a command to switch back to the old {{Switch command. It is called: {{UseOldSwitch. That way also V5.0 can find these strange windwos. Switching is also used by the commands {{SwitchOrStart, {{CheckWindow and {{RelativeMouse.

 

 

17    {{Switch minimizes my target window

 

Question:

I have created a shortcut for starting one of my macros. To have the Recorder minimized from the beginning I have set the shortcut to minimized. If I carry out a {{Switch in my minimized Recorder the target window is also minimized (or normalized if it was already minimized). What can I do to avoid this effect ?

 

Answer:

This effect is caused by the new switch command built into V5.0. The old switch command used an old VisualBasic function. Because Windows has changed over the years, this function was not any longer powerful enough to force all windows up. (In Windows 2000 and later it is not any longer easily possible to force a window to the foreground. Reason for this was the misuse of this function by countless programs. This led to the situation, that when you where e.g. writing a letter suddenly a window came up (maybe because of a new e-mail which arrived). By writing your letter you unintentionally answered the question in the window, without knowing what you had answered…..)
To force a window up in Windows 2000 or later, a trick must be used. (Attaching Threads). This powerful trick brings nearly all windows up, what is definitely necessary for a Mouse and Key Recorder. Because of the "married" threads not just the switching is done, but also the size is inherited by the bound thread.
The Mouse and Key Recorder V5.0 still contains the old switching command. The command: {{UseOldSwitch changes to the old switching technique. The old Switching does not have the mentioned effect.

 

 

18    How to use {{WaitForFocus

 

Question:

I have a question about the WaitForFocus commands. I can't figure out how it works.  I want to wait for a submit to finish, display a new screen and press complete on the new screen.

I insert a "waitfor focus" command in the macro, but I don't understand what it is waiting for and how I correctly use it.  I have studied the manual, but still don't understand. Please help.

 

Answer:

Well, I'll try to explain it in easy words.
The command {{WaitForFocus allows to wait for a windows object like a window or a button.
Let's do an 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 click menu Insert / Focused Object /  Wait For Focus. 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: {{If {{WaitForFocus 322, 478, 75, 23, 100, 3, 3, 3, 3} = {{True};;{{ShowError}. Add the command {{Beep to the macro (Insert / Command / {{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 macro will wait until this focus situation appears or the timeout time runs out.

 

19    Mouse clicks do not click any more during replay

 

Question:

The recorder has stopped replaying mouse clicks, although they get recorded alright. It used to work, and all other recorded actions still work.

 

Answer:

One reason could be, that you recorded your mouse-clicks in mode: Suppress mouse clicking for single clicks and drags. Such commands contain a 1 at the end of the command. Example:

{{RelativeMouse Microsoft Internet Explorer, 1, 1, 58, 61, 1.

To record real clicks set back this mode by clicking menu Tools / Options / Recording and there switch off 'Suppress mouse clicking for single clicks and drags'. (This mode is also resetted when you close and reopen the Recorder.)

To 'repair' your macro you can exchange the 1 at the end of the command to a zero:

{{RelativeMouse Microsoft Internet Explorer, 1, 1, 58, 61, 0.

 

 

20    How to compare text from Excel cells ?

 

Question:

I need to "read" 20 cells in an Excel column. The last column contains the word END. I copy the cells by CTRL c and compare them in the Mouse and Key Recorder using an {{If. But, whatever I do, the word END is never recognized.

 

Answer:

Comparing 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. To compare this in an {{If statement you need to use a string variable. Example:

{{SetString1 END{{CR}{{LF}

{{If {{ClipBoard} = {{String1} ;OK-Action;False-Action

 

 

21    How to use tab as a separator in import files

 

Question:

I need to import a list of goods by using the command {{DoImport. My list uses as separator a tabulator character. How can I use this character in the command {{ImportSeparator ?

 

Answer:

It is not possible to define a tabulator character as separator for {{DoImport. But.. if your list stems from Excel you could create a .csv file which uses a semicolon as separator. Or you use Microsoft Word for replacing the tab to another character e.g. §

 

 

22    Mouse clicks containing a coma in the win. name do not work.

 

Question:

I use a program with a window name: Windman 98, Lakota Ridge. Recorded relative mouse clicks to this window do not work. What can I do ?

 

Answer:

The Mouse and Key Recorder uses comma in the mouse commands to separate parameters. If the window name contains a comma, the wrong parameters are used. Recommendation: Use just the part before the comma for the window name. Another possibility is to use the relative window filter. (You would enter Windman 98 there)

 

 

23    {{String2} in the middle of the line is not working

 

Question:

I use the following command:

{{String1}: Member of department {{String2}

The output contains just String1, the rest is not given out. What is wrong ?

 

Answer:

Output-commands located at the beginning of a line must not be followed by text or other commands. The above line will work when you rewrite it the following way:

{{String1}

: Member of Department

{{String2}

 

Exceptions:

·         Commands needing parameters. Example:
{{RandomNumber {{Var1}, {{Var2}}

·         Commands within a text line. Example:
Mr. Miller works in department {{String2}

 

 

24    {{Loop is not working

 

Question:

I have added a command {{Loop to my macro. But my macro is still running just once. What do I wrong ?

 

Answer:

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 'Loops' 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: You can also use {{GoTo for creating loops.

 

 

25    Macro Abort is often difficult

 

Question:

When I test macros, I often need to stop a macro fast. If I use mouse clicks, this is often very difficult. An abort hotkey would be handy.

 

Answer:

There is such a hotkey… Alt  Pause/Berak. On notebooks often you need to add the Fn key. Restriction: Hotkeys do not work in Windows Vista and Windows 8 if the focus is on the browser.

 

  

 

26    How to interact with a macro

 

Question:

I have many photos that I need to place a message on, but, they are of various sizes with different places to put the message. I need to pick out the photo from a list that is presented and place the message with the mouse click. How can I do this?

 

Answer:

There are two ways for such an interaction.

 

1. You add a {{Stop} to your macro. When your macro stops you go to your graphic application window and you select the file from the list. Then you press 'continue'. The macro must contain a {{Switch command after the {{Stop}.

 

2. Add a {{Beep} and then a {{Delay 5000 to your macro. When you hear the beep you have 5 seconds time to place the cursor (or to select your item), before the macro continues.

 

There are also other possibilities. If you need to choose files you can use the command {{DownLoop to address always the next file during the loops.

Another way is to create a file list by the DOS command: Dir /b > C:\MyList.txt. This file can then be used with {{ImportFile and {{DoImport to open the right graphic files.

In version V6.2 or higher you can use the new command {{ScanDirectories

 

 

27    Infinite Loop

 

Question:

I need to run an Infinite Loop. Can this be done?   

 

Answer:

You can use a very high Loop setting (99'999). If this is too less you can use a {{GoTo command at the end of your macro and jump to the start every time you macro is reaches its end. That way it is really infinite.

 

 

28    Cannot paste to certain windows

 

Question:

For our testing environment, we regularly initialize the Oracle system, entering a selected group of data as our starting point. I want the recorder to help enter this data into Oracle. The script works fine if I paste to a Word Processing program, but does not work with the Oracle screens. The general-delay-mode clearly shows input focus on the Oracle screen but the paste does nothing. Interestingly, if I stop the script, I am able to manually paste the data into the Oracle screen. Any ideas?

 

Answer:

The Mouse and Key Recorder uses a function in VB called SendKeys to simulate keystrokes. The characters are copied to a certain buffer normally filled by the keyboard itself. If a target program uses very special methods to catch the keyboard strokes, it might be it does not recognize the new values in the keystroke buffer.

Another reason could be that your Oracle window is a DOS-Window. As described in the manual the Mouse and Key Recorder is not able to write directly to DOS windows. For writing into a DOS Window you need to use the option {{SendTextSpecial}

 

 

29    Switching to windows with a space in the name

 

Question:

The Mouse and Key Recorder doesn't change focus when I want to replay the keys I've recorded. I used {{Switch and entered enough of the name of my window as to be unique, but the Recorder says it cannot find it. I even entered the entire name of the window and still your utility could not find it.

The window name is long: " WatcherPlus - Version xx.xx.xx ABC: xxx.xxx.xxx.xxx " and begins and ends with spaces.

 

Answer:

The {{Switch and the {{SwitchOrStart commands remove all leading and tailing spaces in the window name. Reason: To avoid an error if the user uses two spaces after the command.

The version V3.2 (and higher) contains a new command: {{KeepSpace. If this command is placed before the {{Switch or {{SwitchOrStart command, all spaces are kept.

 

 

30    Hiding / Closing the Mouse and Key Recorder

 

Question:

How can I hide the Mouse and Key Recorder during run ? How can I close the Mouse and Key Recorder after it has finished ?

 

Answer:

  • You can hide the Mouse and Key Recorder by starting a macro using an icon (example: C:\Programs\Recorder.exe C:\Data\MyMacro.krc). In the icon properties set the windows size to minimized.
  • The Mouse and Key Recorder contains a command called {{Exit. This command closes the Mouse and Key Recorder.
  • A third way is to use the command {{Minimize.
  • V4.3 and higher support also the command line option: MKRMinimize.

 

 

31    Changing names in windows titles

 

Question:

I just downloaded your program to attempt to automate turning on and off cookies.

But I cannot figure out how to SWITCH to Netscape. Using Alt-Tab,

Netscape has a variable or varying Title or Application name. What appears depends on the URL. For instance, now the title bar for Netscape has "Mouse and Key Recorder - Netscape" (your site).

But if another site is visited it might have "WSDOT - Snow and Pass - Netscape".

 

Answer:

You can use a part of the window title, as long it is unique. Here you would use 'Netscape'. As long as you have just one Netscape open, the Mouse and Key Recorder finds your window. Sometimes also the dash (- Netscape) is needed. You might need to experiment what Windows accepts.

 

  

32    Mouse and Key Recorder as DLL

 

Question:

I would like to know if the functions of the key recorder also exist in a DLL. I would like to use it within another application.

 

Answer:

The Mouse and Key Recorder is built in VisualBasic. Therefore it is not possible to convert it into a DLL. What you can do is calling the Mouse and Key Recorder by CommandLine from your application.

 

 

33    How to create a Mouse and Key Recorder icon ?

 

Question:

The Mouse and Key Recorder manual mentions the creation of an icon for using the command line function. How exactly do I create such an icon ?

 

Answer:

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'. Example: "C:\Program Files\RECORDER.EXE" "C:\My Documents\MyMacro.krc". 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).

 

 

34    Random DoImport

 

Question:

After using {{ImportFile is there a way to use the {{DoImport command to select a random line in a text file instead of one line after each other ?

 

Answer:

There is no direct command for your requirement. But you could do the following:

"{{1}{{ImportFile c:\john.txt

{{SetVar1 {{RandomNumber 1, 10}

{{SetVar2 0

{{Label Start

{{IncVar2 1

{{SetString1 {{DoImport}

{{If {{Var1} = {{Var2};;{{Goto Start

{{String1}

{ENTER}

","notepad","","50","0","00","00",#FALSE#,#TRUE#,"1"

 

File John:

Line1,Line2,Line3,Line4,Line5,Line6,Line7,Line8,Line9,Line10

 

 

With V6.4 and later the following is possible:

 

"{{ImportFile c:john.txt

{{ImportNextLine {{RandomNumber 1, 10}

{{DoImport}

{ENTER}

","notepad","","50","0","00","00",#FALSE#,#TRUE#,"1"

 

File John here:

Line1

Line2

Line3

Line4

Line5

Line6

Line7

Line8

Line9

Line10

 

 

35    Sample Macros

 

In the Mouse and Key Recorder Help you can find additional examples.

(Chapter: Macro Examples)

 

 

35.1  Waiting for a text change in an Internet browser

 

{{SetString1 xx123xx67
{{Label Start
{{Delay 1000
{{RelativeDragMouse YourWebSite - Microsoft Internet Explorer, 1, 1, 457, 551, 0, 224, 551, 0

{{' Adapt the {{RelativeDragMouse to your needs !
^c
{{If {{ClipBoard} = {{String1} ;{{Goto Start;

{{SetString1 {{ClipBoard}
{{Beep     {{' Here you can add what you need to do after the text appeared.
{{' …………………..
{{Goto Start

 

Function:
Every second a certain browser location is selected and copied to the clipboard. This text is compared with the text one second ago. As soon as the text changes a beep is generated and the saved text is updated.

 

35.2  Randomize a list of names

 

Sometimes you want to randomize lists. Here a possibility to do this by Mouse and Key Recorder. (Just feasible for small lists)

 

(The file John.txt contains the names. Example:

John,Peter,Antony,Beth)

 

{{' Recorded at: Feb.21.2002, 18:21 (MKR Version: V4.2)

{{' First reading all names from the file john.txt to string variables

{{SetVar1 1

{{ImportFile C:\John.txt

{{Label Start

{{SetString{{Var1} {{DoImport}

{{IncVar1 1

{{If {{Var1} < 5 ;{{Goto Start;

 

{{' Now we get the names randomly. If a name is already taken, we try again.

{{SetVar1 1

{{SetVar3 11

{{Label Start2

{{SetVar2} {{RandomNumber 1,4}

{{If {{String{{Var2}} = #emptyX5# ;{{Goto Start2;

{{SetString{{Var3} {{String{{Var2}}

{{SetString{{Var2} #emptyX5#

{{IncVar1 1}

{{IncVar3 1}

{{If {{Var1} < 5 ;{{Goto Start2;

 

{{' Now we show the string variables

{{MessageBox {{String11}

{{MessageBox {{String12}

{{MessageBox {{String13}

{{MessageBox {{String14}

 

Hint: With V6.4 and newer you could also {{ImportNextLine with a paramteter to access a random line directly.

 

 

35.3  Setting a Hotkey by macro

 

Hotkeys are saved on the PC. To deliver a hotkey together with a macro you can create a hotkey by macro:

 

{{If {{VarHotkeyAlreadyAdded} = 0 ;{{WriteLineToFile å{{AppDataPath}\MacroHotKeys.txtå | åCTRL{{Chr 9}SHIFT{{Chr 9}ALT{{Chr 9}a{{Chr 9}D:\Macros\MyMacro.krcå;

 

{{SetVarHotkeyAlreadyAdded 1

 

Command syntax:

  • {{If {{VarHotkeyAlreadyAdded} = 0: The hotkey should be inserted just once.
  • å{{AppDataPath}\MacroHotKeys.txtå: Path to Hotkey file.
  • åCTRL{{Chr 9}SHIFT{{Chr 9}ALT{{Chr 9}a{{Chr 9}: Hotkey-Combination: CTRL SHIFT ALT a. Further example:
    å-{{Chr 9}-{{Chr 9}ALT{{Chr 9}b{{Chr 9}: Means: ALT b

 

 

35.4  Changing Time format

 

{{Time creates the following format:  17-45-58

Often we would like have this format: 17:45

 

Here a command to change the time format to 17:45:

 

{{MessageBox {{Left {{Replace  {{Time} | - | : | 1 | -1} | 5}

 

 

35.5  Catching a screenshot all 5 minutes

 

The next example catches a screenshot of the Recorder every 5 minutes and saves them to a Word document.

 

{{SendTextSpecial}

{{Label Start

{{Switch #MKRX5#

{{SetVarStartTime {{SerialTime}

{{SetVarEndTime {{VarStartTime}

{{IncVarEndTime 300 {{' Seconds  = 5 Minutes

{{Label Start2

{{Delay 300} {{' Milliseconds

{{If {{SerialTime} > {{VarEndTime} ;{{Goto Continue;

{{Goto Start2

{{Label Continue

%{PRTSC}

{{Switch Microsoft Word

^v

{ENTER}

{{Goto Start

 

 

35.6  Creating random numbers for lottery

 

This macro generates random lottery numbers.

Technique: The problem when generating lottery numbers is the requirement, that each number must occur just once. But a random generator can also generate two or three times the same number…

We could check each number against each other.. This would need 45 comparisons for a 10 number game.. and it needs a complicated loop control..  So we use an array and we put each number to the same location in the array as the number. E.g. the number 39 goes to array location 39. So, if we find an already occupied location in the array we know it is a double number and we try again.

Initialization: Here we set the borders.. No. of balls, max. number.

Part 1: This cleans the array. This is necessary since variables in MKR survive macro load, MKR new start and even a PC reboot.

Part 2: Here we run the random generator and fill in the numbers into the variable bingo and also into the array.

Part 3: Here we convert the numbers to strings and add a zero if necessary. This is required for the following sort function.

Part 4: Sorting the random numbers.

Part 5: Creating a string with all numbers for output by MessageBox.

 

{{' Initialization

{{SetGenDelay 0

{{SetVarNoOfBalls 6

{{SetVarMaxNo 42

 

{{' => Part 1

{{SetVarCounter 1

{{Label Prepare

{{SetVarArray{{VarCounter} 0

{{IncVarCounter 1

{{If {{VarCounter} <= {{VarMaxNo} ;{{Goto Prepare;

 

{{' => Part 2

{{SetVarCounter 1

{{Label Start

{{SetVarBingo{{VarCounter} {{RandomNumber 1,{{VarMaxNo}}

{{If {{VarArray{{VarBingo{{VarCounter}}} <> 0 ;{{Goto Start;

{{SetVarArray{{VarBingo{{VarCounter}} {{VarBingo{{VarCounter}}

{{IncVarCounter 1

{{If {{VarCounter} <= {{VarNoOfBalls} ;{{Goto Start;

 

{{' => Part 3

{{SetVarCounter 1

{{Label Convert

{{If {{VarBingo{{VarCounter}} < 10;{{SetStringBingo{{VarCounter}} 0{{VarBingo{{VarCounter}};{{SetStringBingo{{VarCounter}} {{VarBingo{{VarCounter}}

{{IncVarCounter 1

{{If {{VarCounter} <= {{VarNoOfBalls} ;{{Goto Convert;

 

{{' => Part 4

{{Sort STRING, Bingo, 1, {{VarNoOfBalls}, {{False}

 

{{' => Part 5

{{SetVarCounter 1

{{SetStringOutput Numbers:  

{{Label Output

{{SetStringOutput {{StringOutput}{{StringBingo{{VarCounter}}#spaceX5##spaceX5#

{{IncVarCounter 1

{{If {{VarCounter} <= {{VarNoOfBalls} ;{{Goto Output;

{{MessageBox {{StringOutput}

 

 

35.7  MP3 Randomizer

KeyWords: MP3, Random play (Minimal Recorder Version: V6.5)

 

Lots of MP3 players contain a randomize function. But in some playes (e.g. car radios) this function is missing.

This macro adds a random number in front of the MP3 file name. That way the missing random play function can be added.

Hint: To make the macro faster set the Line Delay to zero.

 

{{' Macro adds a number (Random or Serial) in front of MP3 songs.

 

{{Ask1 Path to MP3 Files |{{StringPathToMP3Files}

{{SetStringPathToMP3Files {{WriteAsk1}

{{Ask1 Lower border (LowerBorder +1 will be used)|{{VarLowerBorder}

{{SetVarLowerBorder  {{WriteAsk1}

{{Label AskForROrS

{{Ask1 (r) Random Numbers or (s) Serial Numbers [z.B. 1001, 1002, 1003..] |{{StringRandomOrSerial}

{{SetStringRandomOrSerial {{WriteAsk1}

{{If {{StringRandomOrSerial} = s ;{{Goto Start;

{{If {{StringRandomOrSerial} <> r ;{{MessageBox Only 'r' or 's' is allowed !;

{{If {{StringRandomOrSerial} <> r ;{{Goto AskForROrS;

{{Ask1 Reserve numbers (The more the faster.. but 0 = no gaps) |{{VarDeltaBorder}

{{SetVarDeltaBorder  {{WriteAsk1}

 

{{Label Start

{{CreateDir C:\Temp

{{DeleteFile C:\Temp\DirList.txt

{{ScanDirectories {{StringPathToMP3Files} | *.MP3 | {{False} | C:\Temp\DirList.txt | {{True}

 

 

{{ImportFile C:\Temp\DirList.txt

{{ImportSeparator >

 

{{SetVarUpperBoarderRead {{Calc {{VarLowerBorder} + {{VarScanDirectoriesX55}}

{{SetVarUpperBoarderReadDelta {{Calc {{VarLowerBorder} + {{VarScanDirectoriesX55} + {{VarDeltaBorder}}

 

{{SetVarCounter {{VarLowerBorder}

{{Label ArrayStart

{{IncVarCounter 1

{{ShowInfo Creating Array Line: {{VarCounter}

{{SetVarRandomArray{{VarCounter}  {{VarCounter}

{{If {{VarCounter} < {{VarUpperBoarderReadDelta} ;{{Goto ArrayStart;

 

{{Label RenameStart

{{SetVarLowerBorderCounter {{VarLowerBorder}

{{SetVarCounter {{VarLowerBorder}

 

{{Label StartSelectMP3

{{IncVarCounter 1

{{IncVarLowerBorderCounter 1

{{ShowInfo Renaming Files Line: {{VarCounter}

{{SetStringFile {{DoImport}

{{SetStringFile {{DoImport}

{{SetStringPath {{DoImport}

{{SetStringPath {{DoImport}

{{SetStringPath {{DoImport}

{{Label TryAgain

{{SetVarRandomNo  {{RandomNumber {{VarLowerBorder}, {{VarUpperBoarderReadDelta}}

{{If {{VarRandomArray{{VarRandomNo }} = 0 ;{{Goto TryAgain;{{Gosub ProcessMP3

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

{{Goto StartSelectMP3

 

{{Label ProcessMP3

{{If {{StringRandomOrSerial} = s ;{{SetStringFileNew} {{VarLowerBorderCounter}_{{StringFile} ;{{SetStringFileNew} {{VarRandomNo}_{{StringFile}

{{RenameFile {{StringPath}{{StringFile} |  {{StringPath}{{StringFileNew}

{{SetVarRandomArray{{VarRandomNo} 0

{{Return

 

{{Label Ende

 

 

35.8  MP3 Pre-Number remover

 

This macro removes the pre-numbers added by the above macro (MP3 Randomizer)

Hint: To make the macro faster set the Line Delay to zero.

 

{{Ask1 MP3-Path |{{StringPathToMP3Files}

{{SetStringPathToMP3Files {{WriteAsk1}

{{Ask1 Position where the normal file name starts |{{VarPosition}

{{SetVarPosition {{WriteAsk1}

{{CreateDir  C:\Temp

{{ScanDirectories {{StringPathToMP3Files} | *.MP3 | {{False} | C:\Temp\DirList.txt |{{True}

{{ImportFile C:\Temp\DirList.txt

{{ImportSeparator >

 

{{Label Start

{{SetString1 {{DoImport}

{{SetString2 {{DoImport}

{{SetString3 {{DoImport}

{{SetString4 {{DoImport}

{{SetString5 {{DoImport}

{{SetString2 {{Mid {{String2} | {{VarPosition} | -1}

{{RenameFile {{String1} | {{String5}{{String2}

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

 

 

35.9  Cleaning (overwriting) Hard disk

KeyWords: Harddisk, erase, clean, overwrite

 

When you want to dispose or sell a used hard disk you need to make sure, all content is deleted beforehand. (Disk might contain private data not suitable for somebody else). There are erasing tools existing, but some of them use low level commands. This can push your hard disk to early death. (At least this happened to one of my disks)

The following macro simply fills the hard disk with a chosen file. The file is copied with a different filename until the disk is full. That way just normal disk access technique is used and that way your disk is not in danger getting defect.

After overwriting simply format the hard disk, which now can be sold.

 

{{' Cleaning Harddisk by overwriting with e.g. Movies

{{' Movies should have a size of at least about 100 MB

 

{{AskSource Path to file which should be used for overwriting (incl. file and extension): |{{StringSource}

{{AskTarget Path to drive which will be overwritten (needs Letter like E:\): |{{StringTargetDir}

{{AskDirNo Number of files per directory (Recommendation: 1000): |{{VarNoOfFilesPerDir}

 

{{SetVarDirCounter 0

{{SetVarFileCounter 0

{{SetStringSource {{WriteAskSource}

{{SetStringTargetDir {{WriteAskTarget}

{{SetVarNoOfFilesPerDir {{WriteAskDirNo}

{{SetVarNoOfFilesPerDirPlus {{VarNoOfFilesPerDir}

{{IncVarNoOfFilesPerDirPlus 1000 {{' Starting with file no 1000

{{If {{Right {{StringTargetDir} | 1} <> \ ;{{SetStringTargetDir {{StringTargetDir}\; {{' Adding \ if necessary

{{SetVarFileSize {{FileSize {{StringSource}}

{{DivVarFileSize 333333 {{' Converting in MB and multiplying with 3

 

{{Label Start

{{SetVarFileCounter 1000 {{' Starting file no with 1000

{{IncVarDirCounter 1

{{SetStringTargetDirCounted {{StringTargetDir}{{VarDirCounter}\

{{CreateDir {{StringTargetDirCounted}

 

{{Label Start1

{{IncVarFileCounter 1

{{CopyFile {{StringSource} | {{StringTargetDirCounted}Pic{{VarFileCounter}.jpg

{{FlashBox Directories: {{VarDirCounter}, Files: {{VarFileCounter}, HDFreeSpace: {{Div {{VarHDFreeSpace} | 1} MB  | 1

{{SetVarHDFreeSpace {{HDFreeSpace {{Left {{StringTargetDir} | 2}}

{{If {{VarHDFreeSpace}  < {{VarFileSize} ;{{Goto Ende; {{' Stop when less than 3 times filesize remains

{{If {{VarFileCounter} < {{VarNoOfFilesPerDirPlus} ;{{Goto Start1;

{{Goto Start

{{Label Ende