Functions
Hot Keyboard provides different function types.Special functions
GoTo <label> Works within "Evaluate Expression" macro only. Transfers the execution line to the one labeled with <label>. Does nothing in other cases. SetVar (<$variable>, <value> [, <scope>]) Sets value of the <$variable> variable to <value>. If <scope> is present and is non-zero, the variable value is saved on Hot Keyboard exit and loaded back on the next run. iif ((<condition>), (<true-expr>), (<false-expr>)) Evaluates <condition> and if the result is non-zero evaluates the <true-expr> sub-expression or evaluates the <false-expr> otherwise. The unused sub-expression is not evaluated at all.
Example:
label: SetVar($msg, InputBox("Enter Email")) iif ( (StrFind ($msg, "@") < 0), ( GoTo "label" ), (1) ) MessageBox($msg)
Arithmetic functions
Function Description ======================= ln (<x>) Natural logarithm lg (<x>) Denary logarithm abs (<x>) Absolute value sin (<x>) Sine cos (<x>) Cosine tan (<x>) Tangent exp (<x>) Exponential sqrt (<x>) Square root asin (<x>) Inverse sine acos (<x>) Inverse cosine atan (<x>) Inverse tangent time Returns current date and time as an integer number with resolution of one second.
String functions
Clipboard Returns clipboard contents (string). Selection Returns currently selected text in an active application. Currency Returns the currency symbols associated with the current user locale. ActiveWindowTitle Returns title of the currently active window. PKKey (<modifiers>, <virtualKey>) Works for Paste Text macros in "Play keys" mode only. Returns special string that represents custom key combination for the play keys mode. Tip: You can create a custom key by using "Special key" -> "Custom key" option in Paste Text macro parameters Examples: ${{ PKKey(00,08) }} - Backspace ${{ PKKey(01,09) }} - Shift+Tab StrLen (<str>) Returns length (number) of the <str>. StrLower (<str>) Returns lowercased <str>. StrUpper (<str>) Returns uppercased <str>. GetEnv (<var>) Returns value of the Windows Environment variable <var>. GetFileDrive (<path>) Returns drive part of the <path>. GetFileDir (<path>) Returns directory part of the <path>. GetFileName (<path>) Returns file name part of the <path>. GetFileExt (<path>) Returns file extension part of the <path>. GetFileDriveDir (<path>) Returns drive and directory parts of the <path>. GetFileNameExt (<path>) Returns file name and extension parts of the <path>. MessageBox (<str>) Displays message box with the <str> text. StrFind (<str>, <substr> [, <startPos>]) Returns first position (number) of <substr> inside <str> starting from <startPos> character or -1 if <substr> is not found. If <startPos> is not given, the function starts from the beginning of <str>. StrRFind (<str>, <ch>) Returns the last position (number) of the first character of <ch> inside <str> or -1 if the one was not found. StrSubStr (<str>, <start> [, <len>]) Returns substring of <str> starting from the position <start> and containing up to <len> characters. If <len> is omitted, the remainder of <str> is returned. StrReplace (<str>, <src>, <dst>) Returns <str> with all occurrences of <src> replaced to <dst>. ReMatch (<str>, <pattern>) Performs PCRE match of <str> against <pattern>. Returns number of sub-patters captured. Also sets the $0..$n variables. FormatTime (<format> [, <time>]) Formats time and date according to the <format> string. If <time> is not supplied, uses the current time and date. %x - default date format (long) %#x - default date format (short) %X - default time format %d - day of month %m - month %y - year (two digits) %Y - year (four digits) %H - hours (24h format) %I - hours (12h format) %M - minutes %S - seconds # - this modifier is used to remove leading zeroes from digits (%#m, %#H, etc) Examples: ${{ FormatTime ("%m-%d-%Y") }} ${{ FormatTime ("%x %X") }} InputBox (<title> [, <value>]) Displays input box with <title> title and allows user to input a string. If <value> is supplied, it is used as default value for the input box. Example: http://www.myshop.com/item.php?id=123&discount=${{ $discount }} ReadFile (<fileName> [, <startPos> [, <length>]]) Reads <length> bytes of the <fileName> file beginning from the <startPos> position. If <startPos> is omitted, the function reads file from the beginning. If <length> is omitted, the functions reads file up to the end. Returns string read. Example: ${{ ReadFile ("c:\Users\username\Documents\prices.txt") }}
Examples
To get a ${{ SetVar( $discount, InputBox ("Enter Discount") ) }} discount, click the link below, the ${{ $discount }} is added to the purchase link: http://www.myshop.com/item.php?id=123&discount=${{ $discount }} Refer to the pricing of other items: ${{ ReadFile ("c:\Users\username\Documents\prices.txt") }}