dfay Posted April 2, 2013 Share Posted April 2, 2013 Here is a simple workflow that uses UI Applescripting (thanks to https://discussions.apple.com/thread/4011487?start=0&tstart=0 ) to delete cookies for a single website in Safari: Delete cookies for specific site on Safari.alfredworkflow I need to do this a lot when switching on VPN after a Google Scholar search....hopefully others will find it useful. Link to comment
dfay Posted September 21, 2016 Author Share Posted September 21, 2016 (edited) 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 September 21, 2016 by dfay Link to comment
DaniTz Posted December 7, 2021 Share Posted December 7, 2021 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now