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

syntax error #49

Open
ginakiele5 opened this issue Apr 11, 2020 · 0 comments
Open

syntax error #49

ginakiele5 opened this issue Apr 11, 2020 · 0 comments

Comments

@ginakiele5
Copy link

		-- 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 deliverySlotFoundTextMsg to targetBuddy
			end tell
			log "text message sent about slot found"
		end if
		
		-- bring Safari window to front and expand to fill screen so delivery slots are clearly visible
		tell application "Safari"
			-- unminimize
			set miniaturized of window id amzn_win_id to false
			-- wait for window to open
			delay 1
			-- maximize window 
			-- this might be useful later on if I want to have it take a screenshot as proof of delivery slots found
			-- Credit for fill to screen: https://macosxautomation.com/applescript/firsttutorial/18.html
			tell application "System Events"
				tell application "Finder" to get the bounds of the window of the desktop
				tell application "Safari" to set the bounds of the front window to ¬
					{0, 22, (3rd item of the result), (4th item of the result)}
			end tell
		end tell
		
		-- signals that the loop should end
		set found_slot to true
	else
		-- encountered unknown page
		-- will navigate back to the cart and from there back to the slot selection page
		log "unknown page encountered"
		restartCheckout(selected_cart_url, amzn_win_id)
	end if
end repeat

else
log "user did not confirm javascript access was enabled. exiting due to insufficient permissions"
end iftell application "Finder"
activate
open document file "delivery-window-finder.scpt" of folder "Amazon-Fresh-Whole-Foods-delivery-slot-finder-master" of folder "Downloads" of folder "ginamariacohen" of folder "Users" of startup disk
end tell
tell application "Finder"
activate
close Finder window id 252
end tell

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

No branches or pull requests

1 participant