Skip to main content

Vision Scripting Guide

In our scripting language, we've introduced new methods to make screen monitoring easier and more intuitive.

Waiting for Text On Screen

This function allows the script to wait until a specific text appears on the screen.

vision.waitForText('Home');

This method is particularly advantageous as it is straightforward for the end-user to implement, as mentioned by Stephen.

Creating Timers, Recordings, and Metadata

Another significant enhancement is the ability to create timers, recordings, and metadata records seamlessly.

local timer = time.createTimer();

local recording = screen.record(function ()
control.right(5);

timer::start()
control.ok();

vision.waitForText("Home", 3_000); // with a 3-second timeout

timer:stop()
end)

local metadata = db.createRecord("App Start 08/30")

local appStartTime = timer:getElapsedTime()
local recordingUrl = asset.upload(recording, "App Start")

metadata:addValues([
["App Start Time", appStartTime],
["Recording URL", recordingUrl]
])

With the ability to integrate these commands within our scripting language, it's now possible to build comprehensive monitoring features right through our script, making the entire process more cohesive.