Copyable Example Code
You can paste this into the code editor; still verify target image, region, color, text, and timing values in your own device flow.
-- File read and write
local path = "macro_log.txt"
-- Write (replaces the file)
File.write(path, "Macro started\n")
-- Append lines
for step = 1, 5 do
File.append(path, "Step " .. step .. " finished\n")
end
-- Read the file back
local content = File.read(path)
if content then
toast("File content:\n" .. content)
else
toast("Could not read the file")
end
-- Check that the file exists
if File.exists(path) then
toast("Log file is present")
end