Created
April 9, 2025 13:36
-
-
Save Lessica/c8f68a69e02ea42b996b6d27f98aa7fd to your computer and use it in GitHub Desktop.
My Awesome Script for XXTouch Elite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nLog("Open “Notes”…") | |
app.run("com.apple.mobilenotes") | |
local x, y | |
while x == nil do | |
nLog("Find “New Note” button…") | |
sys.sleep(1) | |
x, y = screen.find_color({ | |
{1056,2341,0xe4af0a}, | |
{1057,2388,0xe4af0a}, | |
{1105,2389,0xe4af0a}, | |
{1079,2366,0xe4af0a}, | |
{1106,2339,0xe4af0a}, | |
{1113,2332,0xe4af0a}, | |
},95,0,0,0,0) | |
end | |
nLog("Tap “New Note”…") | |
touch.tap(x, y) | |
nLog("Enter text…") | |
sys.sleep(2) | |
key.send_text("Hello, world!") | |
local function tapWord(word) | |
local txts, details = screen.ocr_text {} | |
local tapped = false | |
for i, v in ipairs(txts) do | |
if v == word then | |
touch.tap(details[i].center[1], details[i].center[2]) | |
tapped = true | |
end | |
end | |
return tapped | |
end | |
nLog("Tap “Done”…") | |
while not tapWord("Done") do | |
sys.sleep(1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment