feat: add error handling for Zen browser AppleScript

This commit is contained in:
Beingpax 2025-03-06 20:07:35 +05:45
parent 5d80c68214
commit 9173264407

View File

@ -1,13 +1,25 @@
tell application "Zen Browser" try
activate tell application "Zen Browser"
delay 0.05 try
tell application "System Events" activate
keystroke "l" using command down delay 0.1
delay 0.05 tell application "System Events"
keystroke "c" using command down try
delay 0.05 keystroke "l" using command down
keystroke tab delay 0.1
keystroke "c" using command down
delay 0.1
keystroke tab
on error errMsg
return "ERROR: System Events failed: " & errMsg
end try
end tell
delay 0.1
return (the clipboard as text)
on error errMsg
return "ERROR: Zen Browser activation failed: " & errMsg
end try
end tell end tell
delay 0.05 on error errMsg
return (the clipboard as text) return "ERROR: Zen Browser application not available: " & errMsg
end tell end try