I want to make a small application that will type the number 1, wait an interval, type the number 2, wait an interval, type number 3, wait an interval, etc.
This works for typing one number over and over:
on idle
tell application "System Events"
key code 18
end tell
return 2
end idle
But I'm struggling to get more than number to work:
on idle
tell application "System Events"
key code 18
end tell
return 2
tell application "System Events"
key code 19
end tell
return 2
end idle
This doesn't work. Nor does this:
on idle
tell application "System Events"
key code 18
return 2
key code 19
return 2
end tell
end idle
I don't know what else to try. Thank you!
return
, is there a better way to delay within a handler?keystroke "1"
instead ofkey code
. Keystroke lets you type in any text and have it typed for you.