Somebody at work asked me if it was possible to open Safari (10) in Private Browsing mode in the same way it's possible to do for Chrome. The answer is yes. Sort of.
Open a terminal window and paste this into it.
mkdir ~/.scripts
then all in one go
read -d '' shhfari <<- EOF
#!/usr/bin/osascript
tell application "Safari" to activate
tell application "System Events"
tell process "Safari"
click menu item "New Private Window" of menu "File" of menu bar 1
end tell
end tell
EOF
echo "$shhfari" > ~/.scripts/shhfari.applescript
then
chmod +x ~/.scripts/shhfari.applescript
then
echo 'alias shhfari="~/.scripts/shhfari.applescript"' >> ~/.bash_profile
finally
source ~/.bash_profile
Now when you type:
shhfari
into your terminal it will open open a new Private Browsing window.
It is not elegant.
Made the big script one-liner a bit more user friendly.