$calc = "Calc.exe"
Prompt User "Please enter number to subtract" $number3 -number
Prompt User "Enter first number" $number1 -number
Prompt User "Enter second number" $number2 -number
Open $calc -delay(5)
//If you need to press a key combination, or a single key, you can use the "Press" command to
do so.
//You can also use the "Click" command. However, this is slightly slower as it requires UI detection to 'see' the controls to click.
if ($number1 > 9 or $number2 > 9 or $number3 > 9)
{
Press "{$number1}"
Press "+"
PRessPress "{$number2}"
PRessPress "-"
Press "{$number3}"
Press "="
Show Message Box "Calculated some values using 'Press' command. For {$number1}, {$number2} or {$number3}"
//You can write to the Logs to keep track of what is occuring during a workflow.
Log "Calculated some values using 'Press' command. For {$number1}, {$number2} or {$number3}"
Quit Workflow
}
//NOTE: You have to click one number at a time.
//Since the calculator app only has numbers 0 to 9. (i.e. there is no 23 button).
Click "="
Click "{$number1}" -nearest(".") -second
Log "{$number1}"
Click "+"
Log "Click"
Click "{$number2}" -nearest(".") -second
Log "{$number2}"
Click "-" -second //prevent from clicking minimize icon
Log "-"
Click "{$number3}" -nearest(".") -second
Log "{$number3}"
Click
"="
//You can use "Pause" to pause a workflow before the next step.
Pause
//You can kill a process or close it by using thisthe process name.
Kill Process "CalculatorApp"
Log "CalculatorApp has been closed"
//You can write to the Logs to keep track of what is occuring during a workflow.
Log "Calculated some values using 'Click' command. For {$number1}, {$number2} or {$number3}".
//You can show variable values in notifications such as the toast notification below.
$CalcResult = "Successfully Calculated"
Log $CalcResult |