Hot Keyboard

macros for Windows

Automate Windows with macros
Main Download Purchase Support
<< Previous | Table Of Contents | Next >>

modvar_macro.gif

With this macro, you can modify value of any other Hot Keyboard variable macro.

Action Parameters:

Variable - input (or select from the drop down list) the name of a variable macro which value you want to change. Please note that when you change any local variable macro, Hot Keyboard saves its new value on exit, so it is not lost even after Hot Keyboard restart. On the other hand, if you change a network macro, its value is not changed on server (to reduce traffic) and resets to default right after Hot Keyboard restarts or reloads macros from server. Thus, it is not recommended to change value of network "Variable" macros.

Operation - here you can specify the action that will return a new variable value.

Parameter - a parameter string that is used depending on the operation you select in the above field (details explained below).

Supported operations:

Get selected text. This operation allows grabbing any currently selected text in the active application and putting it into the chosen variable as string (removing rich text formatting). The Parameter field is not used for this operation type and its value is ignored.

The main purpose of this operation is to create several plain text clipboards. E.g. you can create two Variable macros, two Paste macros (that paste these two variables) and two "Modify a variable" macros with "Get selected text" operation. Then you select some text in an application and execute "Modify a variable" macro. It puts selected text into one of two variables leaving another one unmodified.

Assign value. This operation simply assigns any string value to the chosen variable. The value being assigned is entered into the Parameter field.

Evaluate numeric. This operation computes given mathematical expression and assigns numeric result to the chosen variable. The expression is entered into the Parameter field. It can include the following mathematical operations and functions:

  • Real numbers (any number that looks like INTEGER or INTEGER.FRACTIONAL or INTEGER,FRACTIONAL, with an optional negative sign).
  • Hot Keyboard variables (prefixed with dollar sign, e.g. $varname)
  • Addition ( + ), subtraction ( - ), multiplication ( * ) and division ( / )
  • Logical AND (&), OR (|) and XOR (^) operators
  • Boolean AND and OR operators (for conditions)
  • Comparative operators (= > < <> <= >=)
  • Parentheses
  • Mathematical functions (see the list below)

Logical operators treat operands as 32-bit integers and perform the following operations:

  • & - performs logical AND operation (i.e. the result bit is 1 if both corresponding source bits are 1). Example: 10 & 6 = 2,
  • | - performs logical OR operation (i.e. the result bit is 1 if any of the corresponding source bits is 1). Example: 10 | 6 = 14,
  • ^ - performs logical XOR operation (i.e. the result bit is 1 if only one of the corresponding source bits is 1). Example: 10 ^ 6 = 12.

Boolean operators (and, or) differ from logical ones in that they treat operands as 1-bit integers (0 is treated as 0, any other number as 1) and are designed to be used in conditional statements. Examples: 10 and 4 = 1, 10 and 5 = 1, 10 and 0 = 0.

Comparative operators return 1 if the condition is true for given operator and 0 otherwise, e.g.: 10 > 5 = 0, 10 <= 11 = 1.

Hot Keyboard supports the following mathematical functions:

  • abs (x) - absolute value of x,
  • sin (x) - sine of x,
  • cos (x) - cosine of x,
  • tan (x) - tangent of x,
  • exp (x) - exponential of x,
  • sqrt (x) - square root of x,
  • asin (x) - arcsine of x,
  • acos (x) - arccosine of x,
  • atan (x) - arctangent of x.

Here are few examples of allowed mathematical expressions:

  • (1.1 + 2.2 + 3.2)*5.14
  • sqrt ($x*$x + $y*$y)
  • sin ($angle)*$radius
  • $var & 255

<< Previous | Table Of Contents | Next >>

  © 1998-2014 Imposant