/IronAHK/Site/docs/autohotkey/index.html
HTML | 44 lines | 44 code | 0 blank | 0 comment | 0 complexity | 99a37a9b5674825cde7dee5f9542f728 MD5 | raw file
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>AutoHotkey</title>
- <link href="../primary.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="../main.js" defer="defer"></script>
- </head>
- <body>
- <h1>AutoHotkey</h1>
- <div id="page">
- <p>While scripts will function identically to AutoHotkey in almost all cases there are several underlying changes and enhancements.</p>
- <h2 id="syntax">Syntax</h2>
- <p>The script compiler automatically makes the following conversions to ease transition from AutoHotkey:</p>
- <ul>
- <li id="accessors"><em id="accessors">Set</em> commands such as <code>SetKeyDelay</code>, <code>AutoTrim</code> and <code>DetectHiddenWindows</code> have been replaced with accessors to their respective <code>A_</code> variables, i.e. <code>SetWorkingDir, %A_Temp%</code> is translated to <code>A_WorkingDir = %A_Temp%</code>;</li>
- <li id="ifs"><em>If</em> commands are replaced by the equivalent if-statements, e.g. <code>IfGreater, var, 10</code> becomes <code>if var > 10</code>. This includes <code>IfMsgBox</code>, <code>IfInString</code>, <code>IfWinActive</code> and others;</li>
- <li id="strings"><a href="../commands/instr/"><code>InStr</code></a> and <a href="../commands/substr/"><code>SubStr</code></a> are used in place of older string commands like <code>StringLeft</code> and <code>StringTrimRight</code>;</li>
- <li id="repeat"><code>Repeat</code> is converted to <a href="../commands/loop/"><code>Loop</code></a>;</li>
- <li id="debugging"><code>Edit</code>, <code>ListHotkeys</code>, <code>ListLines</code> and <code>ListVars</code> will do nothing until a future version which has improved debugging support.</li>
- </ul>
- <p>In future versions these conversions will be disabled, resulting in compiler errors.</p>
- <h3>New Features</h3>
- <p id="null">Setting a variable to <code>null</code> will <a href="../syntax/variable/#delete">delete</a> it.</p>
- <p id="is">The <code>is</code> keyword has become an expression operator to compare types. </p>
- <p id="json"><a href="../syntax/variable/#object">Objects</a> (associative arrays) and regular <a href="../syntax/variable/#array">arrays</a> can be defined with <a href="http://www.json.org/">JSON</a>. Consequently, the symbols <code>[</code> and <code>]</code> can no longer be used in variable names.</p>
- <p id="parent"> <code>break</code> and <code>continue</code> now have a parameter to indicate which parent loop block should be used.</p>
- <p id="each">An each-loop can be used to enumerate objects and arrays with variables <code>A_LoopKey</code> and <code>A_LoopField</code>. Strings can be accessed this way by every character.</p>
- <p id="delegates">Function names can be used as variables to refer to their pointers (delegates). Any object can be invoked as a late-bound function.</p>
- <h2>Commands</h2>
- <h3>New Functions</h3>
- <ul>
- <li><a href="../commands/#security">Security</a>: encryption, decryption, calculating hashes and generating secure random numbers.</li>
- <li><a href="../commands/#network">Network</a>: resolve host name to IP address (including reverse lookup) and send an email.</li>
- </ul>
- <h2 id="security">Security</h2>
- <p>When scripts are <a href="../overview/compiling/">compiled</a> the source code is not attached to the binary file so it cannot be decompiled. This is unlike AutoHotkey which stores a full copy of the script with the compiled .exe which can be extracted and decrypted or read from process memory when it is executed. </p>
- <h2 id="portability">Portability</h2>
- <p>Scripts will run the same natively on all operating systems and architectures (32 or 64 bit) with a .NET compatible runtime such as <a href="http://www.go-mono.com/">Mono</a>. Almost every version of Windows from XP onwards and most recent Linux desktop distributions have this installed by default.</p>
- <h2 id="unicode">Encoding</h2>
- <p>Source files are read as Unicode text. This is the same for all strings, hotkeys and hotstrings in a script.</p>
- </div>
- </body>
- </html>