PageRenderTime 51ms CodeModel.GetById 11ms RepoModel.GetById 1ms app.codeStats 0ms

/AutoHotkey.docset/Contents/Resources/Documents/misc/Macros.htm

https://gitlab.com/ahkscript/Autohotkey.docset
HTML | 33 lines | 31 code | 2 blank | 0 comment | 0 complexity | 40f742069941c753da10aeca3f97dd3e MD5 | raw file
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Creating a Keyboard Macro or Mouse Macro</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="description" content="Record and play back a keyboard macro or mouse macro with this free macro program. Each macro may optionally be assigned to a hotkey.">
  8. <meta name="keywords" content="macro,macros,keyboard macro,mouse macro">
  9. <link href="../static/theme.css" rel="stylesheet" type="text/css" />
  10. <script src="../static/content.js" type="text/javascript"></script>
  11. </head>
  12. <body>
  13. <h1>Creating a Keyboard Macro or Mouse Macro</h1>
  14. <p>A macro is a series of scripted actions that is &quot;played&quot; upon demand. The most common activity of a macro is to send <a href="../commands/Send.htm">simulated keystrokes</a> and <a href="../commands/Click.htm">mouse clicks</a> to one or more windows. Such windows respond to each keystroke and mouse click as though you had performed it manually, which allows repetitive tasks to be automated with high speed and reliability.</p>
  15. <p>Although macros can be written by hand, you might find it easier to write long ones with the aid of a macro recorder such as the <a href="http://www.autohotkey.com/forum/topic23671.html">Recorder script</a> written by Titan/polyethene. It watches what you type and where you click, and keeps track of which window is <a href="../commands/WinActivate.htm">active</a>. It transcribes these actions into a working macro that can later be &quot;played back&quot; at a faster speed.</p>
  16. <p>One of the most convenient ways to play back a macro is to assign it to a <a href="../Hotkeys.htm">hotkey</a> or <a href="../Hotstrings.htm">hotstring</a>. For example, the following hotkey would create an empty e-mail message and prepare it for a certain type recipient, allowing you to personalize it prior to sending:</p>
  17. <pre>^!s:: <em>; Control+Alt+S hotkey.</em>
  18. IfWinNotExist Inbox - Microsoft Outlook
  19. return <em>; Outlook isn't open to the right section, so do nothing.</em>
  20. WinActivate <em>; Activate the window found by the above command.</em>
  21. Send ^n <em>; Create new/blank e-mail via Control+N.</em>
  22. WinWaitActive Untitled Message
  23. Send {Tab 2}Product Recall for ACME Rocket Skates <em>; Set the subject line.</em>
  24. Send {Tab}Dear Sir or Madam,{Enter 2}We have recently discovered a minor defect ... <em>; etc.</em>
  25. return <em>; This line serves to finish the hotkey.</em></pre>
  26. <p>Hotkey macros like the above are especially useful for tasks you perform several times per day. By contrast, macros used less often can each be kept in a separate script accessible by means of a shortcut in the Start Menu or on the desktop.</p>
  27. <p>To start creating your own macros and hotkeys right away, please read the <a href="../Tutorial.htm">Quick-start Tutorial</a>.</p>
  28. <p>&nbsp;</p>
  29. <p><a href="../AutoHotkey.htm">-- Home --</a></p>
  30. </body>
  31. </html>