Help

We All Need a Hand Sometimes


Express Yourself

Expressions allow you to perform Excel-like formulas to calculate values (Evaluate command) or use in logic (If/Else If Expression commands) to control the sequence of Steps. See the DataColumn.Expression documentation for usage.

 

Using the Stack

You can include values from the stack in your expressions via the keywords {stackTake} and {stackLeave} which remove and leave the value respectively. Items from the stack are removed from left to right as they appear in your expression.

Note that string (text) values need to be properly enclosed, which is generally just surrounded by apostrophes, e.g. 'test string'. This includes when using values from the stack, such as '{stackTake}'.


Example 1

In this example we will get the window title from where the gesture started and see if it matches certain patterns.

 

Get Window Text (Title)

Use the Event Object > Window object to get the window title, then push the title onto the stack.

Steps Expressions 1 - Get Window Title

 

Compare Title

Evaluate the expression to see if the window title matches either pattern. Note that {stackLeave} is used here since we want to evaluate the same value twice, and it will be used in the next Else If Expression Step if it not matched here.

Steps Expressions 1 - If Expression

 

Compare Title Again

If the above condition was not met, evaluate the expression to see if the window title matches this pattern. Note that {stackTake} is used here since we will no longer need the item on the stack.

Steps Expressions 1 - Else If Expression

 

 


Example 2

In this example we will get the top location (via the Rectangle.Top property) of the window where the mouse wheel was scrolled, then the Y coordinate of the mouse location, and perform an evaluation. This Steps sequence is happening within a mouse wheel scroll, so Y is the correct Event Object, where an action's Event Object would be StartPoint.Y.

 

Get Window Rectange Top

Use the Event Object > Window object to get the window's Rectangle.Top value, then push the number onto the stack.

Steps Expressions 1 - Get Window Rectangle Top

Steps Expressions 1 - Get Window Rectangle Top

 

Get Mouse Y Position

Use the Event Object > Y object to get the mouse location's Y coordinate, then push the number onto the stack.

Steps Expressions 1 - Get Window Rectangle Top

 

Evaluate As Boolean

Using the 2 numbers previously added to the stack, see if the mouse location is within 64 pixels of the top of the window (or higher, beyond the window) where the wheel was scrolled. This Step command returns either true or false. Note that {stackTake} is used twice here, and due to the nature of stack order the last item to be added to the stack (mouse Y location) will be the value used for the first {stackTake} reference followed by the window's Top location.

Steps Expressions 1 - Get Window Rectangle Top