ahertel / Amazon-Fresh-Whole-Foods-delivery-slot-finder

A Mac tool that finds available delivery slots for Amazon's Whole Foods delivery and Amazon Fresh services
MIT License
1.03k stars 171 forks source link

"Safari got an error: Can’t get window id 3536." #18

Open lxnxrd22 opened 4 years ago

lxnxrd22 commented 4 years ago

"Safari got an error: Can’t get window id 3536." number -1728 from window id 3536

ahertel commented 4 years ago

@lxnxrd22 That error means that the Safari window used by the tool was closed. When the script starts running it opens a window and then minimizes. That window must stay open at all times while using the tool. Is it possible that you either A) quit Safari or B) closed the window used by the tool?

Other users have reported the same issue as you and the cause of the problem has so far always been either A or B. Let me know your thoughts. Thanks for your message.

lxnxrd22 commented 4 years ago

Thanks for the quick reply :) I think I did close by accident

Very Truly Yours, Len

On Apr 6, 2020, at 8:18 PM, Adrian Hertel notifications@github.com wrote:

@lxnxrd22 https://github.com/lxnxrd22 That error means that the Safari window used by the tool was closed. When the script starts running it opens a window and then minimizes. That window must stay open at all times while using the tool. Is it possible that you either A) quit Safari or B) closed the window used by the tool?

Other users have reported the same issue as you and the cause of the problem has so far always been either A or B. Let me know your thoughts. Thanks for your message.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ahertel/Amazon-Fresh-Whole-Foods-delivery-slot-finder/issues/18#issuecomment-610103251, or unsubscribe https://github.com/notifications/unsubscribe-auth/APCWT3OBKQTRIIGWTGHXSB3RLJWPBANCNFSM4MCWEW2Q.

anniehu4502 commented 4 years ago

"Safari got an error: Can't get window id 2360." 491586276136_ pic_hd

lxnxrd22 commented 4 years ago

Hi,

It worked last night around 2 am I grabbed a slot and my delivery came at 11am, thank you :)

Very Truly Yours, Len

On Apr 6, 2020, at 8:18 PM, Adrian Hertel notifications@github.com wrote:

@lxnxrd22 https://github.com/lxnxrd22 That error means that the Safari window used by the tool was closed. When the script starts running it opens a window and then minimizes. That window must stay open at all times while using the tool. Is it possible that you either A) quit Safari or B) closed the window used by the tool?

Other users have reported the same issue as you and the cause of the problem has so far always been either A or B. Let me know your thoughts. Thanks for your message.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ahertel/Amazon-Fresh-Whole-Foods-delivery-slot-finder/issues/18#issuecomment-610103251, or unsubscribe https://github.com/notifications/unsubscribe-auth/APCWT3OBKQTRIIGWTGHXSB3RLJWPBANCNFSM4MCWEW2Q.

ahertel commented 4 years ago

@lxnxrd22 thanks for letting me know it worked for you! Great to hear!!

ahertel commented 4 years ago

@lxnxrd22 That error means that the Safari window used by the tool was closed. When the script starts running it opens a window and then minimizes. That window must stay open at all times while using the tool. Is it possible that you either A) quit Safari or B) closed the window used by the tool?

Other users have reported the same issue as you and the cause of the problem has so far always been either A or B. Let me know your thoughts. Thanks for your message.

@anniehu4502 Sorry to hear you're having issues. We'll figure it out! Did my above advice to @lxnxrd22 help you?

bertiewooster commented 4 years ago

I experienced this error a few times. Pretty sure it wasn't either A or B every time--I left the computer, and then some minutes later the script gave the error. To alert myself when I needed to restart the script because an error occurred, I added a try...on error block along these lines:

    try
        repeat while found_slot is false
            -- (existing code)
        end repeat
    on error errStr number errorNumber
        -- send text notification
        if sendTexts then
            -- Credit for texting code: Sean Pinkey, https://github.com/spinkney
            tell application "Messages"
                set targetService to 1st service whose service type = iMessage
                set targetBuddy to buddy phoneNumber of targetService
                send (((current date) as string) & ": " & errorMsg & errStr & " #" & errorNumber) to targetBuddy
            end tell
            log "text message sent about error"
        end if
    end try

I tested it by deliberately closing the window, and it worked.

Not sure if there's a way to automate restarting of the loop by re-creating the Safari tab. I like to have a timestamp on the message because iMessage doesn't always show the time if there are several messages not that far apart. And of course, if using the send texts code more than once, it'd be good to write a function for it, passing in the message string.

Thanks for this script! Saved us from having to go out for groceries.

anniehu4502 commented 4 years ago

@lxnxrd22 That error means that the Safari window used by the tool was closed. When the script starts running it opens a window and then minimizes. That window must stay open at all times while using the tool. Is it possible that you either A) quit Safari or B) closed the window used by the tool? Other users have reported the same issue as you and the cause of the problem has so far always been either A or B. Let me know your thoughts. Thanks for your message.

@anniehu4502 Sorry to hear you're having issues. We'll figure it out! Did my above advice to @lxnxrd22 help you?

Thank you so much for the script and I just got the notification for the first time! Really really appreciate it!

Jamethyst commented 4 years ago

@ahertel I'm getting 'safari got an error: can't get window id 3413.' Do you know if that's the same error? I still have everything open. (Struggling to attach screenshot here.) Thank you for creating this. (Even if I can't figure it out on my end. I also have autoimmune disease and was just wishing for something like this!) Forwarding your resume to a friend. Update: Looks like I have it running now. Thank you again. :)

tatianajiselle commented 4 years ago

I got the error from closing a neighboring tab in the safari browser, which then happened to crash the script and suddenly the safari window closed, resulting in the same error. Wondering is anyone also experienced something similar..

ahertel commented 4 years ago

@tatianajiselle the neighboring "empty" tab in the window used by the script must remain open. Please don't close it :) The script opens and closes the amazon webpage tab, which would close the window if this were the only tab in the window. Thus I added the additional empty tab to the window so that the window stays alive at all times. let me know if that helps

bflorinshop commented 4 years ago

I just started using your app today. I'm getting this error: "Safari got an error: Can’t get last tab of window id 1249. Invalid index." number -1719 from last tab of window id 1249

The only Safari window open is the one created by the script for Amazon Fresh. I'm not touching it. But I've gotten this error repeatedly while trying to run the program.

THanks! This is a great service you're doing here.

Reneecakes commented 4 years ago

Hi, thank you for creating this! I keep getting the same error: Safari got an error: Can’t get last tab of window id 682. Invalid index." number -1719 from last tab of window id 682

Before I get the error I get a voice message saying something like "ignore out of stock item". I do not touch the window. Is there something else I could do?