Skip to content

Instantly share code, notes, and snippets.

@macolyte
Created March 14, 2012 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macolyte/2039673 to your computer and use it in GitHub Desktop.
Save macolyte/2039673 to your computer and use it in GitHub Desktop.
Instant Safari Porn Mode
tell application "Safari" to set theURL to URL of current tab of window 1
if theURL contains "some unique part of your URL" then
tellapplication "Safari"
closecurrent tab ofwindow1
endtell
set_private_browsing()
else
set_private_browsing()
tellapplication "Safari"
makenew tabinwindow1
setURLofresultto "your URL"
endtell
end if
on set_private_browsing()
tellapplication "System Events"
tellprocess "Safari"
tellmenu bar 1
tellmenu bar item "Safari"
tellmenu "Safari"
clickmenu item "Private Browsing"
endtell
endtell
endtell
endtell
endtell
end set_private_browsing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment