Last active
April 24, 2020 03:12
-
-
Save s4y/7e7ce25ce2d0c0ff3d0c108ddf30c233 to your computer and use it in GitHub Desktop.
AppleScript which reloads a Whole Foods delivery confirmation page and displays a notification when time slots are available or it otherwise needs attention (e.g. because an item has become unavailable)
This file contains hidden or 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
tell application "Safari" | |
repeat | |
repeat with theWindow in every window | |
repeat with theTab in every tab of theWindow | |
if name of theTab contains "Reserve a Time Slot" then | |
set checkoutWindow to theWindow | |
set checkoutTab to theTab | |
end if | |
end repeat | |
end repeat | |
tell checkoutTab | |
set URL to URL | |
delay 10 | |
if text of checkoutTab does not contain "No delivery windows available" then | |
display notification "Amazon needs your attention!" sound name "Sosumi" | |
set current tab of checkoutWindow to checkoutTab | |
set index of checkoutWindow to 1 | |
end if | |
end tell | |
delay 90 | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment