Jump to content

Delete cookies for specific site on Safari


Recommended Posts

  • 3 years later...

For Safari 10 you need to change the AppleScript so that "Details..." reads "Manage Website Data…"

 

Here's the full script:

 

set theWebsite to "{query}"
tell application "Safari" to activate
delay 2
tell application "System Events" to tell process "Safari"
	keystroke "," using command down
	delay 2
	tell window 1
		click button "Privacy" of tool bar 1
		delay 5
		click button "Manage Website Data…" of group 1 of group 1
		delay 2
		keystroke theWebsite
		delay 1
		keystroke tab
		delay 1
		keystroke "a" using command down
		click button "Remove" of sheet 1
		click button "Done" of sheet 1
	end tell
	keystroke "w" using command down
end tell

 

Edited by dfay
Link to comment
  • 5 years later...

here is a more recent versions, replaced query argument 

 

on alfred_script(q)
set userQuery to text ((offset of "?" in q)+1) thru -1 of q
tell application "Safari" to activate
delay 1
tell application "System Events" to tell process "Safari"
	keystroke "," using command down
	delay 1
	tell window 1
		click button "Privacy" of tool bar 1
		delay 1
		click button "Manage Website Data…" of group 1 of group 1
		delay 1
		keystroke (userQuery)
		delay 5
		keystroke tab
		delay 1
		keystroke "a" using command down
		click button "Remove" of sheet 1
		click button "Done" of sheet 1
	end tell
	keystroke "w" using command down
end tell
end alfred_script

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...