I copied this script from a previous post to enable Private Browsing upon launching Safari web browser.
tell application "Safari" to activate
tell application "System Events"
tell process "Safari" to click menu item "Private Browsing" of menu "Safari" of menu bar 1
end tell
The script works like a charm but I want to extend it to click the OK button and close the Private Browsing dialog box. What do I need to add to this script to achieve this. Everything I’ve tried has failed.
-Xstatical