General Functions A-R - General Functions S-Z - Flow Control Functions
General Information

New in version 3.1 (compared to 3.0)

Macro's:

Macro's can really relieve you of your workload by automatically performing certain (complex) tasks.
A macro can be started by just double-clicking it, with a shortcut to the *.mma file, a Key Combination (like Ctrl+Shift+F6) or an Activate Sequence (a word you have to enter to activate the macro).
A macro consists of a series of functions. Each function can be used to perform a certain task. All the functions together perform the entire task you wanted.

Tip: In the Tronan Macro Editor you can right-click to make a context-menu visible, that you can use to enter a function into the macro-document.

Functions:

A macro script consists of a series of functions. A Function can be executed to perform a certain task. A function can have one or more required parameter(s), one or more optional parameter(s) or both. These parameters can be used to customize the function to your needs. Functions are displayed in black.

Example:
Stop()
Stop()
The function "Stop" has no parameter. When a macro is played and a "Stop" function is encountered, the playback of the macro is stopped.

Required Parameter:

A function can have one or more required parameter(s). The parameters displayed in blue are required. If you do not provide a value for a required parameter, the function will not execute.

Example:
ActivateWindowWithTitle(text WindowTitle)
ActivateWindowWithTitle("RSI-Shield Settings Program")
The function "ActivateWindowWithTitle" has one required parameter: "WindowTitle". You must provide the function "ActivateWindowWithTitle" with a text to indicate which window you want to activate. In this case the text "RSI-Shield Settings Program" is provided to the function, to activate the RSI-Shield Settings Program window.

Optional Parameter:

A function can have one or more optional parameter(s). The parameters displayed in gray are optional. If you do not provide a value for an optional parameter, the function will execute using the default value (Example 1).
When a function has several optional parameters and you want to use a certain parameter, you must use all preceding parameters; you cannot skip a parameter (Example 2).

Example 1:
Beep(text/number BeepType = 1)
Beep(65)
The function "Beep" has one optional parameter: "BeepType". You can provide the function "Beep" with a number to indicate what type of beep you want. If you do not provide a number, the function "Beep" will use the default "BeepType": 1.
In this case the number 65 is provided to the function, to start the playback of BeepType 65.

Example 2:
WaitForWindow(text WindowTitle = "", text/number MaxWaitInMilliSeconds = 30000)
WaitForWindow()
The function "WaitForWindow" has two optional parameters. You have three valid choices:

  1. Do not use any parameter.
  2. Use the first parameter.
  3. Use both parameters.

You cannot decide to use just the last parameter. If you want to use a certain parameter, you must see to it that all preceding parameters are used.

Parameter Types:

There are three types of parameters :

text / text:
The text type consists of one or more characters, for example words or sentences.

number / number:
The number type consists of one or more digits. These can be used for, for example, adding or subtracting.

real / real:
The real type consists of one or more digits separated by a dot.

1/0 / 1/0:
The 1/0 type is a on/off type. 0 stands for off and 1 stands for on.

combination of types:
Sometimes you have a combination of different types. This means that you can choose one of the types. When you see for instance text/number/real as a type, you can choose which parameter type you would like to use. you can provide a text parameter, or you can provide a number or real parameter.

Comment:

You can put comment into the source-code by placing // in front of the sentence. Comment is not parsed by the macro-parser so it will not generate errors. You can also put comment that spans multiple lines, between /* and */

Injecting values of variables into text parameters:

You can inject a value of a variable into a text parameter by placing the name of the variable between % symbols.

Using dynamic variable names (creating a 'kind of' arrays) with the % symbol:

You can do all sorts of tricks with variables by using the % symbol, because you can also dynamically generate variable names by using it.

Example (advanced):

// This example will add some numbers together that are in an array.
// -----------------------------------------------------------------
// Lets create an array of 4 numbers (plus an end-marker)
SetVariable("test[1]", 5) // You do not need to use the [ ] symbols (it is an example)
SetVariable("
test[2]", 15)
SetVariable("
test[3]", 43)
SetVariable("
test[4]", 29)
SetVariable("
test[5]", "End") // The end-marker can be any text or digit you like

// Lets add those numbers together
//-----------------------------------------------------------------------------
SetVariable("index", 1) // Create an index to enumerate the array with
SetVariable("sum", 0) // Create a variable to store the sum of the numbers in

repeat(-1) // Repeat infinitely

SetVariable("value", "%test[%index%]%") // Get the value (at a certain index) from the array

if ("value", "=", "End") // If it is the end-marker

repeat_stop() // we quit the loop

end()

AddToVariable("sum", "%value%") // Add the value to our sum-variable
AddToVariable("index", 1) // Increase the index, so we can query the next value of the array

end()

// Show the sum
AddToVariable("index", -1)
Prompt("There were %index% numbers added.\r\nAnd the sum is: %sum%")

Special symbols in text parameters (variables):

You can begin a new line (linefeed) in a text-parameter by putting the character combination \n into it.
You can insert a carriage return symbol in a text-parameter by putting the character combination \r into it.
(We recommend putting the combination \r\n in a string to begin a new line).

You can insert a double quote symbol in a text-parameter by putting the character combination \" into it.
You can insert a backslash symbol in a text-parameter by putting the character combination \\ into it.
To insert a % symbol without it being used to obtain the value of a variable, one can use the \% combination.

If you want to create a text parameter that spans multiple lines, you can end the line with a single \ symbol, and don't close the parameter
(using ") Example:

Prompt("Line one\
Line two\
Line three
")

RSI-Shield / MacroMachine notes:

MacroMachine macro's are totally compatible with RSI-Shield macro's.If you use RSI-Shield, and MacroMachine on the same PC, the macro functionallity of RSI-Shield will be disabled. If you use the RSI-Shield/MacroMachine macro's you will have the following benefits:

Example macros:

Example 1:
///////////////////////////////////////////////////////////////
// This macro converts Dutch guilders to Euros
///////////////////////////////////////////////////////////////

// Initialize a variable to -1
SetVariable("amount", -1)

// Ask for the amount in Dutch guilders
Input("amount", "Enter the amount in dutch guilders (use a dot as decimal-symbol)", "Euro calculator")

// If the amount was entered we do the calculation
if("amount", ">", -1)

 

// Convert the text variable to the real-type (so we can calculate with it)
ConvertVariableToReal("amount")

// Devide the value of the variable, so it will be in Euros
DevideVariable("amount", 2.20371)

// Show the result
Prompt("Amounts to: %amount% Euro")
end()

Example 2:
///////////////////////////////////////////////////////////////
// This macro converts Euros into Dutch guilders by using
// the standard Windows Calculator
///////////////////////////////////////////////////////////////

// Initialize a variable to -1
SetVariable("amount", -1)

// Ask for the amount in Euros
Input("amount", "Enter the amount in Euros", "Euro calculator 2")

// Remember what the currently active window is, so the WaitForWindow functions
// can reference this point

MarkActiveWindow()

// If the amount was entered we do the calculation
if("amount", ">", -1)

 

// Execute the Windows Calculator and wait for it to show
ExecuteAndWaitForWindow("
calc.exe")

// Enter the formula to convert Euros into Dutch guilders
// into the Calculator

SendKeys("
%amount%[*]2.20371[ENTER]")
end()


New in version 3.1 (compared to 3.0):

/* */ multi-line comment symbols

\ symbol at end of line, means string continues on next line

"Regular Expressions" From now on one can use regular expressions
when trying to find a window, or a sub string in another string
(e.g ActivateWindowWithTitle, and StrFind, etc)

ShowRectangle Will display a rectangle on the screen, for a curtain amount of time.

Calculate Can be used to calculate the result of a formula

if New if-variant, that can handle long evaluations e.g. if ("%a% + 4 > %b% AND ( %a%+1 > %c% OR (%a% = %b%-3)) AND test01 < test02")

StrToFile Append mode added

GetWindow Enumerate through windows and controls

GetWindowRect Retrieve the coördinates of a window

FindChild Search for a child-window/control

GetStatusbarText Retrieve the text of a status bar

FocusWindow Put a control/window active (via mouse click optional)

FindWindow Improved

GetWindowText Improved

Special new Internet Technology added. These commands can be used in the scripting language to control MS Internet Explorer:

I_Connect I_Parse I_Disconnect
I_GetDocumentCount I_GetActiveDocument I_FindElementFromPoint
I_ElementClick I_ElementFocus I_ElementSelect
I_ElementScrollIntoView I_ElementSetValue I_ElementGetRect
I_ElementGetPos I_ElementGetRecurrenceIndex I_ElementGetInfo
I_FindDocumentFromPoint I_BrowserIsBusy I_FindElement
I_SetActiveDocument I_WaitForComplete I_WaitForInteractive
I_BrowserGetURL I_BrowserGetTitle I_BrowserNavigate
I_ElementGetChecked I_ElementSetChecked I_ElementGetHTML

New in version 3.1.1 (compared to 3.1):

Input Improved. Is now auto-scaling.

SynchFiles Added. Can be used to make version-, date-time dependent copies.

New in version 3.1.4 (compared to 3.1.1):

I_WaitForElement Added. Can be used to wait for an element to become available.

SendKeys Improved. Totally rewritten.

I_ConnectToIE Improved. Can now automatically start the Internet Explorer.

New in version 3.1.5 (compared to 3.1.4):

CallURL Added. Can be used to request an internet page from a server, and store its result (without opening a browser i.e. invisible)

SendMail Added. Can be used to send an email message via the SMTP protocol

StrHash Added. Can be used to create a unique id for a text-string


General Functions A-R - General Functions S-Z - Flow Control Functions