Manually start and continue the checkout process until you arrive at the delivery slot page. The session is now initialized. Close this slot page. It's no longer needed.
Turn up the volume to hear the announcement when a slot is found
Adjust your 'Energy Saver' settings in 'System Preferences' so the the display never turns off. Also plug in your laptop, if possible
Go to Safari.
Read the DISCLAIMER
Click 'Continue'. After you answer the prompts, the tool will start searching for slots
DISCLAIMER:
No guarantee that slots will be found and/or that slots will work. Often you will select a slot but the page will refresh and the slot will disappear. These phantom slots are very common and are in Amazon's control, not mine. Eventually a slot should work. Some users report success of after 20+ tries. Wishing you resilience and hope!
FEEDBACK:
Post any concerns/feedback on GitHub issue page" with title "Welcome" with icon stop buttons {"Cancel", "Continue"} default button "Continue"
--> {button returned:"Continue"}
display dialog "Amazon gives notices when items in your cart go out of stock.
Would you like the script to:
A. automatically ignore the warnings so it keep looking for slots (recommended)
B. stop searching for slots until you manually review what went out of stock?" buttons {"Cancel", "A. Keep looking for slots", "B. Wait for me to review"} default button "A. Keep looking for slots" with title "Ignore Out Of Stock?" with icon note
--> {button returned:"A. Keep looking for slots"}
display dialog "The advanced features of this tool involve clicking on and navigating the Amazon website. The following permission MUST be enabled for this tool to run.
INSTRUCTIONS:
While in Safari, push Command-comma together to open Safari Preferences.
Go to the 'Advanced' page on the far right and enable 'Show develop menu in menu bar' at the very bottom.
Click 'Develop' in the menu bar at the top of the screen and click 'Allow Javascript from Apple Events' to enable it.
When finished, click 'Done' to proceed or 'Exit Script' to stop using this tool" with title "More access needed" buttons {"End Script", "Done"} with icon stop default button "Done"
--> {button returned:"Done"}
end tell
tell current application
do shell script "/bin/ls /System/Applications/Messages.app/Contents/Resources/MessagesAppIcon.icns"
--> "/System/Applications/Messages.app/Contents/Resources/MessagesAppIcon.icns"
end tell
tell application "Script Editor"
display dialog "Would you like to receive text messages when delivery slots appear?
Note: If you haven't previously used your Mac's 'Messages' app to send or receive texts, select 'No'" buttons {"Cancel", "Yes", "No"} default button "Yes" with title "Text Notifications" with icon file "System:Applications:Messages.app:Contents:Resources:MessagesAppIcon.icns"
--> {button returned:"Yes"}
display dialog "Please enter desired recipient phone number. Format: 10 digits, no symbols or spaces (e.x. 8002752273)" default answer "" with icon note buttons {"Cancel", "Continue"} default button "Continue" with title "Recipient Phone Number"
--> error number -128
end tell
(user clicked cancel during phone number prompts)
tell application "Script Editor"
display dialog "What delivery service do you want to use this script for?" buttons {"Cancel", "Whole Foods via Amazon.com", "Amazon Fresh"} with icon note with title "Which Service?"
--> {button returned:"Whole Foods via Amazon.com"}
display dialog "The script will start searching for slots once you click 'Continue'.
HOW DO I KNOW IT'S WORKING?
The tool will open and minimize a window once you click 'Continue'. It will quietly search in that window. You won't be get any notifications until A) a slot appears or B) an item goes out of stock and you selected to be notified. If you want to verify the script is running, you can open the minimized window and watch it open and close the slot page every ~60 seconds. You can then minimize the window again or leave it open. Just don't close it" buttons {"Cancel", "Continue"} with title "Configuration Complete" with icon note default button "Continue"
--> {button returned:"Continue"}
end tell
tell application "Safari"
make new document
--> document "Favorites"
get id of window 1
--> 750
make new tab with properties {URL:"https://www.amazon.com/gp/buy/shipoptionselect/handlers/display.html?hasWorkingJavascript=1"}
--> missing value
set current tab of window id 750 to last tab of window id 750
--> error number -1719 from last tab of window id 750
Result:
error "Safari got an error: Can’t get last tab of window id 750. Invalid index." number -1719 from last tab of window id 750
tell application "Script Editor" display dialog "Welcome to Delivery Slot Search Tool!
INSTRUCTIONS:
DISCLAIMER:
No guarantee that slots will be found and/or that slots will work. Often you will select a slot but the page will refresh and the slot will disappear. These phantom slots are very common and are in Amazon's control, not mine. Eventually a slot should work. Some users report success of after 20+ tries. Wishing you resilience and hope!
FEEDBACK:
Post any concerns/feedback on GitHub issue page" with title "Welcome" with icon stop buttons {"Cancel", "Continue"} default button "Continue" --> {button returned:"Continue"} display dialog "Amazon gives notices when items in your cart go out of stock. Would you like the script to: A. automatically ignore the warnings so it keep looking for slots (recommended) B. stop searching for slots until you manually review what went out of stock?" buttons {"Cancel", "A. Keep looking for slots", "B. Wait for me to review"} default button "A. Keep looking for slots" with title "Ignore Out Of Stock?" with icon note --> {button returned:"A. Keep looking for slots"} display dialog "The advanced features of this tool involve clicking on and navigating the Amazon website. The following permission MUST be enabled for this tool to run.
INSTRUCTIONS:
HOW DO I KNOW IT'S WORKING?
The tool will open and minimize a window once you click 'Continue'. It will quietly search in that window. You won't be get any notifications until A) a slot appears or B) an item goes out of stock and you selected to be notified. If you want to verify the script is running, you can open the minimized window and watch it open and close the slot page every ~60 seconds. You can then minimize the window again or leave it open. Just don't close it" buttons {"Cancel", "Continue"} with title "Configuration Complete" with icon note default button "Continue" --> {button returned:"Continue"} end tell tell application "Safari" make new document --> document "Favorites" get id of window 1 --> 750 make new tab with properties {URL:"https://www.amazon.com/gp/buy/shipoptionselect/handlers/display.html?hasWorkingJavascript=1"} --> missing value set current tab of window id 750 to last tab of window id 750 --> error number -1719 from last tab of window id 750 Result: error "Safari got an error: Can’t get last tab of window id 750. Invalid index." number -1719 from last tab of window id 750