Am writing a script to delete a specific Safari cookie/cache. To do this manually requires going to Safari -> Preferences -> Privacy -> Manage Website Data -> entering a value into Search text area.
The following script successfully gets to the Manage Website Data dialog box but entering the value fails.
I suspect some sort of trickery on Apple’s to hide the gui elements from being properly accessed by a script, meaning that the usual methods must be hacked somehow. Am using OS X 10.13.6 (High Sierra) and Safari 11.1.2.
Here’s the code so far:
tell application “System Events”
tell process “Safari”
– go to Preferences…
click menu item 4 of menu 1 of menu bar item 2 of menu bar 1
tell window 1
click button “Privacy” of toolbar 1
– go to Manage Website Data:
click button 1 of group 1 of group 1
tell sheet 1 --should enter value BUT FAILS: keystroke deCookie end tell