How to record and play keystrokes, example based on copying file names from Windows Explorer to Excel

Problem

Some times it is needed to repeat the same key sequence many times. An example: to copy file names from Windows Explorer to another application. Windows standard copy/paste function doesn't allow this. Watch a video tutorial and read details below:

Solution

Hot Keyboard allows you to record a sequence of keystrokes and repeat them a number of times at desired speed. We will record sequence to copy file name once and repeat them for all files in the folder.

Requirements

Hot Keyboard 6.5.117 or above

Step-by-step

  1. First of all we need to create a sequence to put in a loop. Hot Keyboard can record mouse clicks also, but we will focus on keyboard shortcuts, and some you will find it helpful in the future.
  2. Remember this key sequence: F2, Ctrl+C, Alt+Tab, Ctrl+V, Down, Alt+Tab, Down
  3. Open Excel sheet and click with left mouse button to the first cell.
  4. Open Excel and click on the first cell
  5. Open Explorer, go to a folder with files, and click on the first file with you mouse left button.
  6. Open Explorer and click on the first file
  7. Double click on Hot Keyboard icon in the toolbar and click "New macro" button, then select "Record/play keystrokes" macro
  8. Open Hot Keyboard and create Record/Play macro
  9. In a macro properties uncheck "Record and play mouse events" as we don't need mouse to be recorded
  10. Open Hot Keyboard and create Record/Play macro
  11. Click Record keystores and mouse actions button (two alerts may popup, read them and close)
  12. When record begins repeat key sequence F2, Ctrl+C, Alt+Tab, Ctrl+V, Down, Alt+Tab, Down in a given order once, and then press Ctrl+Break to stop macro recording
  13. Hot Keyboard window opens back.
  14. Set playback speed to "4x" and repeat count to a number of files minus one (you already copied the first file),
  15. Set a hot key to start this macro, for example Ctrl+Alt+Shift+M
  16. Close Hot Keyboard
  17. Click on Explorer's title to activate the window
  18. Press Ctrl+Alt+Shift+M
  19. If something went wrong, press Ctrl+Break to stop macro execution and verify steps above
  20. Relax and drink coffee

Tips

  • Ctrl+Break stops both record and playback, alternatively you can double-click Hot Keyboard icon in the toolbar
  • You can adjust playback speed to execute macro several times faster. Use with care, if you PC is not very fast, Hot Keyboard may play keys faster than Windows can accept. We recommend x4 value for this macro.
  • You may wish to assign a hot key to execute the macro any time. But remember to close all windows and set initial position. Hot Keyboard simply repeats keystrokes. Explorer should be active window before you start macro
  • There is a global hot key you can set to start macro record, set it to create record/play macros quickly