Far be it from me to squash a person's use of Alfred2!
So, with the understanding that one may want to focus Safari IN Private mode with Alfred, I modified Dave's script slightly to use key press, in order to prevent the dialog from showing up at all. Basically, this is just like holding down the OPT key when selecting the menu item.
Just modify/replace the original script as such:
tell application "Safari" to activate
tell application "System Events" to tell process "Safari"
key down option
if menu item "Private Browsing" of menu 1 of menu bar item 2 of menu bar 1 exists then
click menu item "Private Browsing" of menu 1 of menu bar item 2 of menu bar 1
key up option
Keep in mind, Dave gets credit for the idea and original scripting ... I only removed one tiny little dialog box.
I wrote a weather forecaster workflow that displays forecasts from Dark Sky or the Weather Underground. This is actually the second iteration; my first was loosely based on David Ferguson's weather workflow, but written in Python. This version is a complete rewrite in Go.
The source, along with installation and setup instructions, is available at it at https://github.com/jason0x43/alfred-weather.The most current release can be found at https://github.com/jason0x43/alfred-weather/releases.