Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lxnxrd22 opened this issue Apr 7, 2020 · 13 comments
Open

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

lxnxrd22 opened this issue Apr 7, 2020 · 13 comments
Assignees
Labels
question Further information is requested

Comments

@lxnxrd22
Copy link

lxnxrd22 commented Apr 7, 2020

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

@ahertel
Copy link
Owner

ahertel commented Apr 7, 2020

@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.

@ahertel ahertel added the question Further information is requested label Apr 7, 2020
@ahertel ahertel self-assigned this Apr 7, 2020
@lxnxrd22
Copy link
Author

lxnxrd22 commented Apr 7, 2020 via email

@anniehu4502
Copy link

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

@lxnxrd22
Copy link
Author

lxnxrd22 commented Apr 7, 2020 via email

@ahertel
Copy link
Owner

ahertel commented Apr 7, 2020

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

@ahertel
Copy link
Owner

ahertel commented Apr 7, 2020

@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?

@ahertel ahertel changed the title I got this message "Safari got an error: Can’t get window id 3536." Apr 7, 2020
@bertiewooster
Copy link

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
Copy link

@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
Copy link

Jamethyst commented Apr 10, 2020

@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
Copy link

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
Copy link
Owner

ahertel commented Apr 10, 2020

@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
Copy link

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
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

8 participants