Using AppleScript as Auto Hotkey on Mac

In order to conduct thorough testing of Soylent 1.6, I recently purchased over 20 boxes. However, there is one problem - Safari does not support automatic form filling. Therefore, I have to manually enter all of my credit card information in order to pay for shipping fees and customs duties. This means I have to manually input all of my credit card information for calculating shipping fees and customs duties.

All the payment steps involve only numbers, dates, resumes, and passwords.

After repeating this process over and over again, I am absolutely exhausted.

It should be automated.

God, when I was still using Windows four years ago, I thought of AutoHotkey.

For Mac users, there is AppleScript, which can simulate keyboard inputs and mouse clicks.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
tell application "Safari"
activate
end tell

tell application "System Events"
tell process "Safari"
set frontmost to true

-- you can get the screen coordinate by pressing `cmd+shift+4`
click at {1420, 500}
-- wait 1 second for the website to load
delay 1
click at {1305, 615}

delay 10
click at {1090, 369}
-- simulate pressing **6** on the keyboard
keystroke "6"
keystroke "6"
keystroke "0"
-- ...
keystroke "6"
keystroke "4"
delay 1
click at {1083, 426}

end tell

end tell

Moreover, I discovered an interesting thing during this process - the cvv cannot be clicked by the script.

It seems that the bank’s website has implemented some security measures.

Translated by gpt-3.5-turbo