| General Functions A-R |
ActivateWindowWithClass(text ClassName)
This function has one required parameter:
text ClassName: The name (or a part of it) of the class of a window.You can activate a window with a certain class to, for example, make sure the macro is executed in the correct application. A class-name is an invisible name that identifies a certain type of window. Every window in Windows as such a class-name. You can determine the class-name of a window by using the Tronan Spy tool in the Tronan Macro Editor.
You can provide the exact class-name of a window (Example 1), or you can provide part of the class-name of a window by using "*" signs (Example 2).Power Tip: You can also use regular expressions with this function. All you have to do is put the indicator 'REGEXPR:' in front of the one of the search parameters. Click here for some examples.
Example 1:
// A window with the exact class-name "Notepad" is activated.
ActivateWindowWithClass("Notepad")
Example 2:
// A window of which the class-name ends with 'otepad' is activated.
ActivateWindowWithClass("*otepad")
ActivateWindowWithIdentifier(text/number Identifier)
This function has one required parameter:
text/number Identifier: The identifier of a windowThis function activates a window with a certain identifier. Every window in Windows has such an identifier. An identifier is a number that uniquely identifies a window. The identifier is only valid for the duration of the live-span of the window. Once the window is destroyed, the identifier becomes invalid.
Example:
ExecuteAndWaitForWindow("notepad.exe")
GetActiveWindowIdentifier("notepad_id")
// Do something else...// Activate the notepad again
ActivateWindowWithIdentifier("%notepad_id%")
ActivateWindowWithTitle(text WindowTitle)
The function ActivateWindowWithTitle has one required parameter:
text WindowTitle: Title of a window, or part of the title of a window.
You can activate a window with a certain title to, for example, make sure the macro is executed in the correct application.
You can provide the exact title of a window (Example 1), or you can provide part of the title of a window by using "*" signs (Example 2).
Providing part of a window title can be useful when, for example, the window title reflects a document name, so you don't know the exact window title.NOTE: you can also add another dependency, namely the class name. You can add this by putting the class name in front of the window title and separate the two by the == symbol (two equal signs).
Power Tip: You can also use regular expressions with this function. All you have to do is put the indicator 'REGEXPR:' in front of the one of the search parameters. Click here for some examples.
Example 1:
// A window with the exact title "RSI-Shield Settings Program" is activated.
ActivateWindowWithTitle("RSI-Shield Settings Program")Example 2:
// A window is activated with "Microsoft Word" somewhere in the title, regardless of the document name which is displayed in the title.
ActivateWindowWithTitle("*Microsoft Word*")
Example 3:
// The calculator is activated, using the class name, and the title.
ActivateWindowWithTitle("SciCalc==Calculator")
AddToVariable(text VariableName, text/number/real Value)
The function AddToVariable has two required parameters:
text VariableName: Name of an existing variable.
text/number/real Value: Value to add to the value of the variable.
You can add a certain value to the value of an existing variable by using this function.
This way, you can add numbers to value's of existing variables or subtract them (Example 1).
Also, you can combine strings (Example 2) or add the value of a variable to the value of another variable (Example 3).
Remember that the type of the added value is automatically converted to the type of variable. So, if the variable is of the type "text", the value is also converted to the type "text" (Example 4). For more information about the "text/number/real" types, look at the general information.
Before using this function, you should use SetVariable to declare the variable.
Example 1:
// Let's say the value of the variable "counter" is 1. The number 2 is added to the value of the variable "counter" (1 in this case).
// So, the new value of the variable "counter" is 3. If you want to subtract, just add a negative number.
SetVariable("counter", 1)
AddToVariable("counter", 2)
Example 2:
// The variable "name" has the value "John". The sir name "Doe" is added to the "name" variable.
// So, the new value of the variable "name" is "JohnDoe".
SetVariable("name", "John")
AddToVariable("name", "Doe")
Example 3:
// The variable "name" has the value "John". The variable "sirname" has the value "Doe". The value of the variable "name"
// is added to the value of the variable "sirname". So, the new value of the variable "name" is "JohnDoe".
SetVariable("name", "John")
SetVariable("sirname", "Doe")
AddToVariable("name", "%sirname%")Example 4:
// The variable "name" has the value "John" and is of the "text" type. The value which is added to the "name" variable,
// is 12 and is of the "number" type. The value 12 is converted to the type "text", because the variable "name" is of the type "text".
// So, the new value of the variable "name" is "John12" and is of the "text" type.
SetVariable("name", "John")
AddToVariable("name", 12)
Beep(text/number SoundFrequency, text/number SoundDuration)
The function Beep has two required parameters:
text/number SoundFrequency: Windows NT/ 2000: [in] Specifies the frequency, in hertz, of the sound. This parameter must be in the range 37 through 32,767 (0x25 through 0x7FFF).
text/number SoundDuration: Windows NT/ 2000: [in] Specifies the duration, in milliseconds, of the sound.The Beep function generates simple tones on the speaker. The function is synchronous; it does not return control to its caller until the sound finishes. The function Beep can be useful when you want to give audio feedback, for example, when a macro has been fully executed or to draw the attention of a user when a prompt is displayed.
NOTE: On Windows 95 the Beep function ignores the dwFreq and dwDuration parameters. On computers with a sound card, the function plays the default sound event. On computers without a sound card, the function plays the standard system beep.
Example:
// Make a beeping sound
Beep(1000, 100)
BlockInput(text/number BlockEnabled)
The function BlockInput has one required parameter:
text/number BlockEnabled: Indicates whether or not the input should be blocked (0 = don't block, 1 = block)Use the function BlockInput when you want to block all user input. One does not need to explicitly call BlockInput(0) at the end of the script (it is called implicitly).
Example:
// Block all user input
BlockInput(1)
SendKeys("A user can not enter anything when this is being entered by the script.")
Calculate(text VariableName, text Formula, text/number ReturnResultAsInteger = 0 )
This function has two required parameters, and one optional parameter:
text VariableName: The name of the variable to store the result into.
text Formula: Formula you'd like the result of.
text/number ReturnResultAsInteger: Specifies the result type (double or integer).
This function can be used to calculate the result of a formula.Example:
// Calculate 12 MODULES 5
Calculate("result", "((1+2)*4) % ((2*5)/2)", 1)
// Calculate the Square Root of 9 times the Sinus of 3
Calculate("result", "SQRT(9) * SIN(3)")
Call(text Application, text Parameters = "", text StartupDirectory = "", text/number MaxWaitInMilliSeconds = 30000)
The function Call has one required and 3 optional parameters:
text Application: The name of an application
text Parameters: The command line that should be passed to the application
text StartupDirectory: The folder from which the application should be executed
text/number MaxWaitInMilliSeconds: The maximum time the macro should wait for the application to finish
This function can be used to execute an application. The diffence between this function and the function Execute, is that this function waits for the application to finish. Furthermore, you can NOT start linked file-types with this command. So you can NOT start a word document just by executing the document-file itself. Use the Execute command for that.Example:
// The following macro starts the Windows notepad and waits for it to finish
LoadSystemVariables()
Call("notepad.exe", "", "%FOLDER_WINDOWS%", 45000)
Prompt("Notepad was closed")
CallScript(text ScriptName, text Password = "")
This function has one required parameter:
text ScriptName: The name of the script to execute (you must not add the .tma extension)
text Password: If the script you call is protected by a password, you can provide that password hereThis function can be used to execute another script from within a script. You can test if the called script ran correctly. The result will be 1 if it was successful and 0 if it was not.
Example:
// We want to handle the errors ourself
StopOnFailure(0)
// Execute the system macro: '&Open Macros Folder'
CallScript("&Open Macros Folder")
if_failed()// Something went wrong so we stop the script
Stop()end()
// Do something else (the CallScript function did OK)...
CallURL(text URL, text VariableName)
This function has two required parameters:
text URL: The URL you like to call
text VariableName: The name of the variable that can be used to store the result returned by the internet serverThis function can be used to call a certain URL on the internet and obtain the result that the server sends back. This function is different from the other internet functions
because it will execute invisible. This way you can also examine the contents of an Internet page without opening the browser.
Example:
// Let's check the latest version of MacroMachine
CallURL("http://www.tronan.com/macromachine.version", "latest_version")
Prompt("%latest_version%")
ChangeWindow(text Action, text WindowTitle = "", text/number Value1 = 0, text/number Value2 = 0)
This function has one required and 3 optional parameters:
text Action: The action that should be performed on the window
text WindowTitle: The title (or a part of the title, using the * symbol) of a window. When no title is provided, the currently active window is used.
text/number Value1: The first value to be used with the Action parameter (only applicable for the types SET_POSITION and SET_SIZE)
text/number Value2: The second value to be used with the Action parameter (only applicable for the types SET_POSITION and SET_SIZE)
Action Value1 Value2 Description MAXIMIZE Maximizes the window MINIMIZE Minimizes the window RESTORE Restores the window to its previous size NORMAL Shows the window in its normal state HIDE Hides the window CLOSE Closes the window SET_POSITION x coordinate y coordinate Changes the position of the window SET_FOREGROUND Makes the window the foreground window SET_STAYONTOP Makes the window stay on top (even if it becomes inactive) SET_SIZE width in pixels height in pixels
Changes the size of the window SET_CENTER Places the window in the center of the screen Use this function to change a window. You can resize a window, close it, hide it, and much more. You can also combine actions in one call.
Power Tip: You can also use regular expressions with this function. All you have to do is put the indicator 'REGEXPR:' in front of the one of the search parameters. Click here for some examples.
Example:
// Execute notepad, resize it to 250x250 and then center it
ExecuteAndWaitForWindow("notepad.exe")
ChangeWindow("SET_SIZE|SET_CENTER", "", 250, 250)
ConvertVariableToNumber(text VariableName)
This function has one required parameter:
text VariableName: The name of the variable to convert to a number-variable-typeUse this function to convert a variable that has a certain type, to a number-type.
Example:
// Initialize the house number with the text 10
SetVariable("house_number", "10")
// Convert the house number to a number, so you can calculate with it
ConvertVariableToNumber("house_number")
// Calculate the neighbours house number
AddToVariable("house_number", 2)
// Show the result
Prompt("The neighbours of number 10 live at number %house_number%")
ConvertVariableToReal(text
VariableName)
This function has one required parameter:
text VariableName: The name of the variable to convert to a real-variable-typeUse this function to convert a variable that has a certain type, to a real-type.
Example:
// Initialize the body length with the text 180.25 cm
SetVariable("body_length", "180.25 cm")
// Convert the body length to a real-number, so you can calculate with it
ConvertVariableToReal("body_length")
// Calculate the height of the fence
MultiplyVariable("body_length", 2)
// Show the result
Prompt("The fence is twice as high as I am, so it is %body_length% cm")
ConvertVariableToText(text VariableName)
This function has one required parameter:
text VariableName: The name of the variable to convert to a text-variable-typeUse this function to convert a variable that has a certain type, to a text-type.
Example:
// Initialize name with the text-value John
SetVariable("message", "John is ")
// Initialize the age with the number-value 21
SetVariable("age", 21)
// Convert the age to a text-type, so we can append it
ConvertVariableToText("age")
// Append the age-text to the message-text
AddToVariable("message", "%age%")
// Show the result (John is 21)
Prompt("%message%")
CopyFile(text SourcePath, text DestinationPath, text/1/0 StopIfCopyFails = 0)
This function has two required parameters, and one optional parameter:
text SourcePath: The path of the source (you can use wildcards)
text DestinationPath: The path of the destination
text/1/0 StopIfCopyFails: flag to indicate whether the command should be considered failed if one of the copies did not succeedUse this function to copy some files from one location to another.
Example: // Copy all *.txt files from the C:\Source folder to the C:\Dest folder
// If one of them fails to copy, we just ignore it
CopyFile("C:\Source\*.txt", "C:\Dest\")
// Do not stop the macro if one of the commands fails
StopOnFailure(0)
// Copy readme.txt from C:\Source to C:\Dest, while renaming it to already read.txt
// The command should not ignore failures
CopyFile("C:\Source\readme.txt", "C:\Dest\already read.txt", 1)
// Check if the copy command failed
if_failed()
Prompt("Could not copy the file") end()
CountFiles(text VariableName, text SearchPath)
This function has two required parameters
text VariableName: The name of the variable to store the number of files counted into.
text SearchPath: The path to search in (you can use wildcards)Use this function to count the number of files in a certain directory.
Example: // Count the number of text files in to root
CountFiles("count", "C:\*.txt")// Show us how many there are
Prompt("There are %count% text files in the root")
This function has one required parameter:
text FolderPath: The path of the folder that should be created
Use this function to create a folder. It works recursively. So if you provide the path C:\Temp1\Temp2\Temp3 all three folders are created if they do not exist already.Example:
// Lets create a folder (if the folders C:\Temp1 and C:\Temp1\Temp2 do not exist, they are created first)
CreateFolder("C:\Temp1\Temp2\Temp3")
DeleteFile(text Path, text/1/0 StopIfDeleteFails = 0)
This function has one required parameter, and one optional parameter:
text Path: The path of the files to delete (you can use wildcards)
text/1/0 StopIfDeleteFails: flag to indicate whether the command should be considered failed if one of the files could not be deletedUse this function to delete some files.
Example: // Delete all *.txt files from the C:\Temp folder
// If one of them fails to delete, we just ignore it
DeleteFile("C:\Temp\*.txt")
// Do not stop the macro if one of the commands fails
StopOnFailure(0)
// Delete readme.txt from C:\Temp
// The command should not ignore failures
DeleteFile("C:\Temp\readme.txt", 1)
// Check if the delete command failed
if_failed()
Prompt("Could not delete the file") end()
DevideVariable(text VariableName, text/number/real Value)
The function DevideVariable has two required parameters:
text VariableName: Name of an existing variable.
text/number/real Value: Value to add to the value of the variable.
With this function you can devide the value of a variable by another value.
Remember that the type of the variable is automatically converted to the type real. So, if the variable is of the type "text", it will be of the type real after deviding. For more information about the "text/number/real" types, look at the general information.
Before using this function, you should use SetVariable to declare the variable.Example:
// Let's determine how many euros is the same as 10 guilders
SetVariable("Guilders", 10)
SetVariable("Euros", "%Guilders%")
DevideVariable("Euros", 2.20371)
Prompt("%Guilders% guilders amounts to %Euros% euros")
EnsureWindowWithIdentifier(text/number Identifier = 0)
This function has one required parameter:
text/number Identifier: The identifier of a windowThis function activates a window with a certain identifier and guaranties that the script will stop as soon as this window is not the foreground window anymore. You can stop this enforcement by calling this function without parameters. If you do not, it will be enforced for the duration of the entire script.
If you have used this function to ensure a certain window, every function in the script (following this function) checks if that window is in the foreground, if it is not it will be put to the foreground. If the window does not exist anymore, the script will stop. Input functions like 'SendKeys', 'KeySequence', 'MouseMove' etc. even check this before each key-press or mouse-movement.
Every window in Windows has such an identifier. An identifier is a number that uniquely identifies a window. The identifier is only valid for the duration of the live-span of the window. Once the window is destroyed, the identifier becomes invalid.
Example:
ExecuteAndWaitForWindow("notepad.exe")
GetActiveWindowIdentifier("notepad_id")
EnsureWindowWithIdentifier("%notepad_id%")
// Do something else...// This will activate the notepad again, and the text will only be entered if it is in the foreground
SendKeys("This text will only be entered into the notepad.")
Execute(text FilePath, text Parameters = "", text StartupDirectory = "")
This function has one required and two optional parameters:
text FilePath: The name of file
text Parameters: The command line that should be passed to the application
text StartupDirectory: The folder from which the application should be executed
This function can be used to execute an application or to launch a document. The diffence between this function and the function Call, is that this function does not wait for the application to finish. Furthermore, you can start linked file-types. So you can start a word document just by executing the document-file itself.Example:
// The following macro starts the Windows notepad and waits for it to finish
LoadSystemVariables()
Execute("notepad.exe", "", "%FOLDER_WINDOWS%")
// Start a word document
Execute("letter.doc", "", "%FOLDER_MYDOCUMENTS%")
ExecuteAndWaitForWindow(text FilePath, text Parameters = "", text StartupDirectory = "", text/number MaxWaitInMilliSeconds = 30000)
This function is the same as the function Execute, but it has an additional parameter:
text/number MaxWaitInMilliSeconds: The maximum number of miliseconds to wait for a new window to appearUse this function to execute an application or document, just like you would use the Execute command. This command, however, waits until a new window appears. A new window has appeared if the foreground window has changed since the beginning of the script, or since the last MarkActiveWindow command, or since the last ...WaitForWindow.. variant command.
This command implicitly calls MarkActiveWindow.Example:
// Start the calculator and wait for it to show up
ExecuteAndWaitForWindow("calc.exe")
// Do some calculations
SendKeys("1+5[ENTER]")
FindChild(text/number WindowIdentifierParent, text Class, text Title, text VariableName = "wndID")
This function has three required parameter, and one optional:
text WindowIdentifierParent: The identifier of the window in which the search has to be made.
text Class : The class name of the window to search for (if no class name is provided, only the the Title parameter will be used)
text Title : The title of the window to search for (if no title is provided, only the the Class parameter will be used)
text VariableName: The name of the variable to store the identifier of the found window in.Use this function to find a child window or control with a certain class name and/or title. If the window or control is found, the identifier will be returned.
Example:
// Find a notepad window, and store the identifier
FindWindow("NOTEPAD", "")
// Find the edit control within Notepad
FindChild("%wndID%", "Edit", "")
// Get the text of Notepad
GetWindowText("%wndID%")
// Display the contents of Notepad
Prompt("Notepad contains this text:\
\
%wndText%")
FindWindow(text Class, text Title, text VariableName = "wndID")
This function has two required parameter, and one optional:
text Class : The class name of the window to search for (if no class name is provided, only the the Title parameter will be used)
text Title : The title of the window to search for (if no title is provided, only the the Class parameter will be used)
text VariableName: The name of the variable to store the identifier of the found window in.Use this function to find a window with a certain class name and/or title. If the window is found, the identifier of that window will be returned.
This function always uses regular expressions (click here).Example:
// Find a notepad window, and store the identifier
FindWindow("NOTEPAD", "")// Activate notepad
ActivateWindowWithIdentifier("%wndID%")
FocusWindow(text WindowIdentifier, text UseMouseClick = "0")
This function has one required parameter, and one optional:
text WindowIdentifier: The identifier of the window that has to get the focus.
text UseMouseClick: Specifies if a left mouse click should used on the control, after the focus has been set.Use this function to put the focus on (i.e. activate) a certain window or control, and thus making it available for input. One can also specify to use a left mouse click (for instance, to press a button).
Example:
// Start Notepad
ExecuteAndWaitForWindow("Notepad.exe")// Put some text in there, and open the Find box
SendKeysAndWaitForWindow("Some text...[CTRL]f")// Get the identifier of the Find box
GetActiveWindowIdentifier("wndID")// Look for the "Match case" option (which is the fourth child of the box)
GetWindow("%wndID%", "1.4")// Put the focus on the "Match case" option
FocusWindow("%wndID%")// Toggle "Match case" on, using the spacebar
SendKeys("[SPACE]")
GetActiveWindowClass(text VariableName)
This function has one required parameter:
text VariableName: The name of the variable that can be used to store the class-name inUse this function to determine the class-name of the currently active window. Every window in Windows has such an class-name. A class specifies what kind of window the window is.
Example:
ExecuteAndWaitForWindow("notepad.exe")
GetActiveWindowClass("notepad_class")
// Do something else...// Activate the notepad again
Prompt("%notepad_class%")
GetActiveWindowIdentifier(text VariableName)
This function has one required parameter:
text VariableName: The name of the variable that can be used to store the identifier inUse this function to determine the unique identifier of the currently active window. Every window in Windows has such an identifier. An identifier is a number that uniquely identifies a window. The identifier is only valid for the duration of the live-span of the window. Once the window is destroyed, the identifier becomes invalid.
Example:
ExecuteAndWaitForWindow("notepad.exe")
GetActiveWindowIdentifier("notepad_id")
// Do something else...// Activate the notepad again
ActivateWindowWithIdentifier("%notepad_id%")
GetActiveWindowTitle(text VariableName)
This function has one required parameter:
text VariableName: The name of the variable that can be used to store the class-name inUse this function to determine the title of the currently active window. Every window in Windows has such an title (caption).
Example:
ExecuteAndWaitForWindow("notepad.exe")
GetActiveWindowTitle("notepad_title")
// Do something else...// Activate the notepad again
Prompt("%notepad_title%")
GetCursorPos(text VariableNamePosX, text VariableNamePosY)
This function has two required parameters:
text VariableNamePosX: The name of the variable that can be used to store the X coordinate
text VariableNamePosY: The name of the variable that can be used to store the Y coordinateUse this function to determine the position (coordinates) of the cursor (mouse arrow). The coordinates returned, will be relative to the entire screen.
Example:
// Repeat forever
repeat(-1)// Get the cursor position
GetCursorPos("x", "y")
// Show it for a second
TimeoutPrompt("X:%x%, Y:%y%", "Tronan Macro", 0, 1000)// Stop if the OK button gets pressed
if ("last_result", "=", 1) repeat_stop() end()
end()
GetGlobalValue(text VariableName, text ValueName)
This function has two required parameters:
text VariableName: The name of the variable to store the result in
text ValueName: The name of the Global Value one wants to retrieveThis function is used to retrieve a Global Value. Global Values can be used to pass data between different Macro Scripts.
Example:
// Call a script to get the name of the user
CallScript("getname")
GetGlobalValue("globalVal", "FirstName")
IsVariable("globalVal")
if_succeeded()// This prompt will display the first name
Prompt("The first name is: %globalVal%")end()
GetRSIShieldValue(text VariableName, text ValueName)
This function has two required parameters:
text VariableName: The name of the variable that can be used to store the class-name in
text ValueName: The name of the value you want to query from RSI-Shield
Value Name Description auto_mouse_click_enabled Determine if the auto mouse click function is enabled. auto_snooze_enabled Determine if the auto-snooze (when using a modem) function is enabled. break_warning_time Determine the time (in seconds) before a break when the break-notification will be shown. break_warning_enabled Determine whether or not a notification will be shown before a break starts. consider_natural_breaks Determine whether or not the RSI-Shield intelligence considers the breaks users take naturally. consider_user_input Determine whether or not RSI-Shield stops counting down (the counter) when a user does not use the PC. countdown_on_user_input Determine how many seconds are counted down when a user uses the computer briefly. current_profile Determine the name of the currently active user profile. days_since_installation Determine how many days ago RSI-Shield was installed. disable_keyboard_during_break Determine whether or not RSI-Shield blocks keyboard input during a break. disable_mouse_during_break Determine whether or not RSI-Shield blocks mouse input during a break. empty_macro_hotkey_pos Find a free position for a new hotkey for a macro (0-74). empty_trigger_pos Find a free position for a new trigger (activation sequence) for a macro (0-74). hours_visible Determine whether or not the hours are shown in the counter (in the system tray). in_active_period Determine whether RSI-Shield is currently in an active period (i.e. when not in a break). is_network_version Determine if RSI-Shield is running as a network version (or stand-alone version). key_sound Determine the name of the sound that will be played when a user hits a key (will be empty if no sound is selected). keyboard_2_mouse_translator_enabled Determine if the 'keyboard 2 mouse translator' is enabled. When it is, one can control the mouse with the keyboard. keyboard_currently_disabled Determine if the keyboard is currently being blocked (only possible during breaks). macro_hotkey([i]Index, [o]VirtualKey, [o]Modifiers, [o]Path)
Determine which macro, can be activated with which key combination at a certain index (Index = a number between 0 and 74). (Click here for VirtualKey ,Modifiers). Path = the path of the found macro (relative to the Macros root-folder). (Auto-variable-prefix = MH_).
macro_hotkey_by_name([i]MacroName, [o]VirtualKey, [o]Modifiers, [o]Index) Determine which key combination activates a certain macro, and at which index the macro-hotkey is located (Index = a number between 0 and 74). MacroName = the path of the macro relative to the Macros root-folder (e.g. 'My Macros\\Quick.tma'). (Click here for VirtualKey ,Modifiers). (Auto-variable-prefix = MHBN_).
macro_trigger([i]Index, [o]Sequence, [o]Path) Determine which macro, can be activated with which sequence of characters, at a certain index (Index = a number between 0 and 74). Path = the path of the found macro (relative to the Macros root-folder). (Auto-variable-prefix = MT_). max_exercises Determine the maximum number of exercises that will be played during a break. max_snooze_count Determine the maximum number of times one can postpone a break. max_snooze_time Determine how many seconds a snooze-action will jump back in time (will only work if the max_snooze_time_enabled value is set, so first query that value). max_snooze_time_enabled Determine whether or not the maximum snooze time is overridden by the user. If the value is 0, postponing a break will give the maximum amount to work. If the value is 1, the max_snooze_time value specifies how many seconds of working time one will regain. minutes_visible Determine whether or not the minutes are shown in the counter (in the system tray). mouse_currently_disabled Determine if the mouse is currently disabled. natural_break_multiplier([i]BreakIndex) Determine which multiple of the length of the corresponding break type, is considered to be a natural break. e.g. If the length of a micro break is 60 seconds, and the 'natural break multiplier' is 2, then one should not touch the PC for 120 seconds, to make RSI-Shield treat the break as a valid natural break. network_ok Determine if the network is ok, will only work if RSI-Shield is installed as a network version. no_discipline_mode_enabled Determine if the no-discipline mode is enabled. pause
Determine if RSI-Shield is currently in a break. profile_folder Determine the folder in which RSI-Shield keeps its profiles. ras_connected Determine if RAS is connected i.e. a modem is being used. ras_installed Determine if RAS is installed i.e. Dialup connection via a modem. registered Determine if RSI-Shield is successfully registered (only for non-network versions). registration_code Determine the registration code (only if RSI-Shield is registered). registration_username Determine the user name with which RSI-Shield is registered (if at all). seconds_since_creation Determine how long RSI-Shield has been running this day. seconds_sincelast_input Determine how long the computer has not been used by a person. seconds_till_break([i]BreakIndex) Determine how many seconds it will take to get the next break of a specified type (BreakIndex). show_exercises_during_break([i]BreakIndex) Determine if exercises will be shown during a specific type of break (BreakIndex). skin Determine the name of the skin (the appearance of the counter) that is currently used. snooze_count Determine how many times the upcoming break has already been postponed. snooze_key_combination([o]ModifierKeys) Determine the key combination that can be used to postpone breaks. The returned value specifies the virtual key code. And the output variable will receive the modifier keys. (Click here for VirtualKey ,Modifiers). (Auto-variable-prefix = SKC_). snooze_notification_animation Determine whether or not a notification movie will be played when a break is postponed. sound_enabled Determine if sounds are enabled. If so, sounds will be played to notify users of events (beginning of a break etc.) statistics_number_of_days Determine how many days are logged in the statistics-log. statistics_of_day([i]Password, [i]DayIndex, [i]KeyOfInterest, [o]Year, [o]Month, [o]Day, [o]SecondsSinceCreation, [o]TotalSnoozeCount, [o]NaturalBreaks1Taken, [o]NaturalBreaks2Taken, [o]NaturalBreaks3Taken, [o]NaturalBreaksTakenInSeconds, [o]ForcedBreaks1Taken, [o]ForcedBreaks2Taken, [o]ForcedBreaks3Taken, [o]ForcedBreaksTakenInSeconds, [o]RunningInActivePeriodInSeconds, [o]TotalNumberKeyHits, [o]TotalNumberOfMouseButtonHits, [o]MouseDistanceInMeters, [o]KeyHits, [o]LeftButtonClicks, [o]LeftButtonDblClicks, [o]MiddleButtonClicks, [o]MiddleButtonDblClicks, [o]RightButtonClicks, [o]RightButtonDblClicks) Obtain the statistic-information that has been logged for a specific day. With DayIndex you can specify of which day you want the data. DayIndex begins at 1 and ends with 'statistics_number_of_days' (which is probably the current day). Furthermore you should provide a Password, if the user has protected his/her profile with one (otherwise just provide the word NONE). And if you are interested in how many times a specific key was pressed, you should provide the virtual key code; KeyOfInterest. (Click here for VirtualKey explanation). The KeyHits value will then be filled with the number of presses of that key. (Auto-variable-prefix = SOD_). (If the wrong password was provided, the return value will be: 'Wrong password')
system_id Determine the system id of the PC. timeline([o]SmallestActivePeriod, [o]SmallestBreakPeriod, [o]ActivePeriod2Multiplier, [o]BreakPeriod2, [o]ActivePeriod3Multiplier, [o]BreakPeriod3) Determine the time line of RSI-Shield. This time line specifies exactly when a micro, medium, or macro break should be held. SmallestActivePeriod = The time one can work, SmallestBreakPeriod = The Micro break length (seconds), ActivePeriod2Multiplier = Every which time a Medium break will be held i.s.o. a Micro break, BreakPeriod2 = The Medium break length (seconds) etc. (Auto-variable-prefix = TL_).
timeline_period_info([i]Index, [o]Seconds, [o]Style, [o]From, [o]To) Retrieve all information about a time line segment. Index = a segment index, beginning at zero, and ending at timeline_periods_count - 1. Seconds = Length of period, Style = Type of period (1 = Active period, 2 = micro, 3 = medium, 4 = macro break), From = The first second of the period, To = The last second of the period. (Auto-variable-prefix = TLPI_).
timeline_periods_count Determine how many periods are on the time line. timeline_position Determine the current position (in seconds) of RSI-Shield on the time line. trial_days_left Determine how many trial days are left. trigger_by_name([i]MacroName, [o]Sequence, [o]Index) Determine which sequence of characters activates a certain macro, and at which index the sequence is located (Index = a number between 0 and 74). MacroName = the path of the macro relative to the Macros root-folder (e.g. 'My Macros\\Quick.tma'). (Auto-variable-prefix = TBN_).
twice_as_fast Determine of RSI-Shield is currently counting down twice as fast (as normal). Because someone has postponed breaks earlier. [i] = required value, as input
[o] = optional variable name, for outputYou either provide all optional output variable names, or you provide none. If you provide none, the Macro will automatically generate the variables with the shown names, prefixed with the first letter of every word of the value name. e.g. macro_hotkey(1) will automatically create the variables MH_VirtualKey, MH_Modifiers, and MH_Path. Those variables will receive the values queried for.
Virtual Key Codes: A special code that identifies an actual key on the keyboard Click here for a table.Modifiers: A key combination with one or more of these keys: Alt (1), Ctrl (2), Shift (4), Win (8). You just add the values together to create a combination (e.g. if Modifiers = 7, the keys Ctrl+Alt+Shift are all used).
BreakIndex: Some values require that you specify a break index. This means that the value is valid for a micro break, medium break, and macro break. So you have to specify via an index, in which one you are interested (1 = Micro break, 2 = Medium break, 3 = Macro break)Use this function to get information from the RSI-Shield counter.
Example:
// Determine what skin RSI-Shield is using
GetRSIShieldValue("skin_name", "skin")
Prompt("Skin: %skin_name%")// Determine how many times the spacebar was pressed on the first day
GetRSIShieldValue("result", "statistics_of_day(NONE, 1, 32)")
Prompt("Spacebar pressed on the first day: %SOD_KeyHits%")// Determine what activate-sequence can be used for Quick.tma, and which index this sequence has
GetRSIShieldValue("result", "trigger_by_name(My Macros\\Quick.tma, SequenceVar, IndexVar)")
Prompt("Activate sequence, and index of macro 'Quick.tma': %SequenceVar%, %IndexVar%")
GetStatusbarText(text/number WindowIdentifierParent, text VariableName = "wndText")
This function has one required parameter, and one optional:
text WindowIdentifierParent: The identifier of the window one wants to get the statusbar text from.
text VariableName: The name of the variable to store the statusbar text in.Use this function to retrieve the text of the status bar of a certain window. The text of the different panes are stored in an array like fashion within the variable (e.g. wndText.0 = pane 1, wndText.1 = pane 2 etc.) If one ommits to use the pane differentiator, the text of all the panes is returned (e.g. wndText = pane 1|pane 2 etc.)
Example:
// Start Internet Explorer
ExecuteAndWaitForWindow("IExplore.exe")// Get the identifier of the Find box
GetActiveWindowIdentifier("wndID")// Connect to the Internet Explorer
I_Connect("%wndID%")// Navigate it to the Tronan site
I_BrowserNavigate("http://www.tronan.com")// Get the status text of the browser
GetStatusbarText("%wndID%", "status")// Display the first pane of the status bar
Prompt("%status.0%")
GetTickCount(text VariableName)
This function one required parameter:
text VariableName: The name of the variable that can be used to store the X coordinateThe GetTickCount function retrieves the number of milliseconds that have elapsed since the system was started. It is limited to the resolution of the system timer. The elapsed time is stored as a DWORD value. Therefore, the time will wrap around to zero if the system is run continuously for 49.7 days. You can use this function to determine how long a certain task has run, or (if you don't call it at a regular frequency) you can use it to generate semi-random numbers.
Example:
// Determine the initial tick value
GetTickCount("begin_tick")// Show a message
Prompt("This macro measures, how long it takes for you to close this box.")// Get the current tick value
GetTickCount("delta")// Calculate the difference between the two tick values
AddToVariable("delta", "-%begin_tick%")// Prompt the user with the result
Prompt("It has taken you: %delta% milliseconds")
GetWindow(text/number WindowIdentifier, text/number SearchType, text VariableName = "wndID")
This function has two required parameter, and one optional:
text WindowIdentifier: The identifier of the window you want to start the search from
text SearchType: The way the search needs to be done. Can be one of the following options: next, prev, first, last, owner, parent, desktop, foreground, focus, or a search structure (e.g. 1.3.2.5)
text VariableName: The name of the variable to store the window identifier of the found window inUse this function to search for a certain window, using another window as a start point. By using this function one can, for instance, enumerate through all child windows of a window. Especially the structure search method is pretty useful. This method can enumerate through the windows, using a search string, that specifies where the window can be found. E.g. "1.3.2" means, get the first child of the start window, from that point get the third child, and from that point get the second child. One can examine these structures of windows by using the TronanSpy (disable the Simple mode).
Example:
// Start Notepad
ExecuteAndWaitForWindow("Notepad.exe")// Put some text in there, and open the Find box
SendKeysAndWaitForWindow("Some text...[CTRL]f")// Get the identifier of the Find box
GetActiveWindowIdentifier("wndID")// Look for the "Match case" option (which is the fourth child of the box)
GetWindow("%wndID%", "1.4")// Put the focus on the "Match case" option
FocusWindow("%wndID%")// Toggle "Match case" on, using the spacebar
SendKeys("[SPACE]")
GetWindowRect(text VariableName, text WindowIdentifier)
This function has two required parameters:
text VariableName: The name of the variable to use to store the rectangle coördinates in
text WindowIdentifier: The identifier of the window one wants to get the coördinates ofUse this function to obtain the rectangle of a window. It returnes the absolute screen position of the window, plus the width, and the height. The variable has 4 properties: left, top, width, height
Example:
// Start the Calculator
ExecuteAndWaitForWindow("Calc.exe")// Get its identifier
GetActiveWindowIdentifier("wndID")// Search for the 5 button
FindChild("%wndID%", "Button", "5")// Retrieve its rectangle
GetWindowRect("rect", "%wndID%")// Show the rectangle
ShowRectangle("%rect.left%", "%rect.top%", "%rect.width%", "%rect.height%")// Allow the rectangle to stay visible for 2 seconds
Wait(2000)
GetWindowClass(text WindowIdentifier, text VariableName = "wndClass")
This function has one required parameter, and one optional:
text WindowIdentifier: The identifier of the window one wants to get the class name of
text VariableName: The name of the variable to store the class name of the found window inUse this function to obtain the class name of a window.
Example:
// Find a calculator window, and store the identifier
FindWindow("", "Calculator")// Get the class name of the found window
GetWindowClass("%wndID%")// Display the found class
Prompt("%wndClass%")
GetWindowText(text WindowIdentifier, text VariableName = "wndText")
This function has two required parameter, and one optional:
text WindowIdentifier: The identifier of the window one wants to get the title of
text VariableName: The name of the variable to store the title of the found window inUse this function to obtain the title of a window.
Example:
// Find a notepad window, and store the identifier
FindWindow("NOTEPAD", "")// Get the title name of the found notepad window
GetWindowText("%wndID%")// Display the found title
Prompt("%wndText%")
I_BrowserGetTitle(text VariableName)
This function has one required parameter:
text VariableName: The name of the variable that can be used to store the browser title inThis function can be used to obtain the title of the browser.
Example:
// Start the Internet Explorer
ExecuteAndWaitForWindow("IExplore.exe")
// Get its window handle
GetActiveWindowIdentifier("wndID")
// Connect to the browser
I_Connect("%wndID%")
// Navigate it to the Tronan site
I_BrowserNavigate("http://www.tronan.com")
// Wait until the browser has finished loading the page
I_WaitForComplete(5000)
// Get the title of the browser
I_BrowserGetTitle("title")
// Show the title
Prompt("%title%")
I_BrowserGetURL(text VariableName)
This function has one required parameter:
text VariableName: The name of the variable that can be used to store the browser 's URL inThis function can be used to obtain the URL of the browser.
Example:
// Start the Internet Explorer
ExecuteAndWaitForWindow("IExplore.exe")
// Get its window handle
GetActiveWindowIdentifier("wndID")
// Connect to the browser
I_Connect("%wndID%")
// Navigate it to the Tronan site
I_BrowserNavigate("http://www.tronan.com")
// Wait until the browser has finished loading the page
I_WaitForComplete(5000)
// Get the URL of the browser
I_BrowserGetTitle("url")
// Show the URL
Prompt("%url%")
I_BrowserIsBusy(text VariableName)
This function has one required parameter:
text VariableName: The name of the variable that can be used to store the browser title inThis function can be used to obtain the title of the browser.
Example:
// Start the Internet Explorer
ExecuteAndWaitForWindow("IExplore.exe")
// Get its window handle
GetActiveWindowIdentifier("wndID")
// Connect to the browser
I_Connect("%wndID%")
// Navigate it to the Tronan site
I_BrowserNavigate("http://www.tronan.com")
// Determine if the browser is busy
I_BrowserIsBusy("busy")
// Prompt the busy state of the browser if("%busy%=1") Prompt("Browser is busy")else() Prompt("Browser is idle")end()
This function has one required parameter:
text URL : The internet address to navigate the browser toThis function can be used to navigate the browser to a certain URL
Example:
// Start the Internet Explorer
ExecuteAndWaitForWindow("IExplore.exe")
// Get its window handle
GetActiveWindowIdentifier("wndID")
// Connect to the browser
I_Connect("%wndID%")
// Navigate it to the Tronan site
I_BrowserNavigate("http://www.tronan.com")
I_Connect(text/number BrowserWindowIdentifier = 0)
This function has one optional parameter:
text/number BrowserWindowIdentifier: The window identifier of the browser one wants to connect to. If one omits the identifier, this command will start a new instance of the Internet Explorer, and connects to it.This function can be used to connect to a browser that one wants to control, or retrieve information from. This command HAS TE BE USED before any other Internet command.
Example:
// Start the Internet Explorer
ExecuteAndWaitForWindow("IExplore.exe")
// Get its window handle
GetActiveWindowIdentifier("wndID")
// Connect to the browser
I_Connect("%wndID%")
// Navigate it to the Tronan site
I_BrowserNavigate("http://www.tronan.com")Example 2:
// Start the Internet Explorer, and connect to it
I_Connect(0)
// Navigate it to the Tronan site
I_BrowserNavigate("http://www.tronan.com")
This function has no parameters:
This function can be used to disconnect from a browser. This is not a absolutely needed command. It only frees up some memory.
Example:
// Start the Internet Explorer
ExecuteAndWaitForWindow("IExplore.exe")
// Get its window handle
GetActiveWindowIdentifier("wndID")
// Connect to the browser
I_Connect("%wndID%&qu