Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

Use this page to find example workflows for Genta Automation.

...

Script

...

This example will open Windows Calculator, enter some values to calculate, and write to the log.

Code Block
$calc = "Calc.exe"
Open $calc -delay(5)
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, use the "Press" command
//You can also use "Click" command, but this is slightly slower as it requires UI detection to 'see' the controls to click
if ($number1 > 9 or $number2 > 9 or $number3 > 9)
{
Type "$number1Press "{$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
}
//NOTE: You have to click one number at a time
//Since Calculator app does not have a 23 button for example
Click "$number1" -nearest("+")
Click "+"
Click "$number2" -nearest("+")
Click
"-" -nearest("+") //prevent from clicking minimize icon
Click "$number3" -nearest("+")
Click "="
//You can use Pause to pause a workflow before the next step
Pause
//You can kill a process or close it by using the 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 = "successfullySuccessfully calculatedCalculated"
Log $CalcResult

Include Page
Snippet - How-to Foot - Aria
Snippet - How-to Foot - Aria
Multiexcerpt fast include block macro
name

...

Related Articles

...

Filter by label (Content by label)
showLabelsfalse
max10
showSpacefalse
cqllabel in ( "kb-how-to-article-aria" , "kb-tech-aria" , "get" , "log" , "message" , "write" , "windows" , "calculator" , "example" ) and label in ( "kb-command-reference-aria" , "kb-how-to-article-aria" , "kb-tech-aria" )

...