Jump to content
dave_parki_uk

Safari Private Browsing Toggle

Recommended Posts

I do not want to throw a wrench into this and believe me when I say that sharing workflows is awesome, especially with all that Alfred 2 can do ... but for an even more 'simple' approach: Would it not require less work (key pressing) to simply specify a shortcut to the Safari menu item "Private Browsing" without the ellipses?

 

For me it seems that one key combo, in my case CMD+SHIFT+P toggles Safari's private browsing directly: I do not have to open Alfred, then type a command.

 

I am only mentioning the following in case you or others are not aware of the built-in functionality of OS X and it's keyboard preference pane:

 

1: Open System Preferences from the Apple Menu

2: Click on Keyboard

3: If not already selected, Select "Keyboard Shortcuts"

4: In the left pane, select Application Shortcuts

5: Just under the right pane, click on the "+" button

6: Open the "Application:" dropdown, and select "Safari"

7: In the "Menu Title" box, type (without quotes) "Private Browsing"

8: Select the box to the right of "Keyboard Shortcut" then, hit the keys you want to be the shortcut to toggle Private Browsing

9: Hit the OK button

 

Now switch back to Safari, and hit your shortcut ... and it will toggle Private Browsing ON/OFF without the dialog.

Share this post


Link to post
Guest Viktor

But with the workflow, you don't need to remember an extra hotkey.

 

The good shortcuts may be taken by important apps and functions. 

 

And you can toggle it with this workflow even though the frontmost app is not safari.

 

 

I think the app is great,

 

thanks dave_parki_uk :D

Share this post


Link to post

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
end if
end tell

Keep in mind, Dave gets credit for the idea and original scripting ... I only removed one tiny little dialog box.

Edited by RodgerWW

Share this post


Link to post

Thanks dave_parki_uk!

 

If you run OS X on a different language than English you have to edit the script on three lines:

 

On line 3 and 5 change "Private Browsing…" to your language.

On line 8 change "Private Browsing" (without the tree dots) to your language.

Edited by TKilaker

Share this post


Link to post

Hi,

 

Since I moved to OSX 10.9 Maverick and I face a very strange behavior with that workflow.

The script (version updated by  RogerWW) lock the option key of my keyboard, and the only way to unlock the key is to reboot my mac.

Does anyone has already have that problem ? 

Is it an issue with applescript in Maverick ?

 

BR

 

Nicolas

Share this post


Link to post

Hi,

 

Since I moved to OSX 10.9 Maverick and I face a very strange behavior with that workflow.

The script (version updated by  RogerWW) lock the option key of my keyboard, and the only way to unlock the key is to reboot my mac.

Does anyone has already have that problem ? 

Is it an issue with applescript in Maverick ?

 

BR

 

Nicolas

Did you try Dave's original script? That works fine now for me in Mavericks. There is no box that comes up anymore.

Share this post


Link to post

Hi,

 

Since I moved to OSX 10.9 Maverick and I face a very strange behavior with that workflow.

The script (version updated by  RogerWW) lock the option key of my keyboard, and the only way to unlock the key is to reboot my mac.

Does anyone has already have that problem ? 

Is it an issue with applescript in Maverick ?

 

BR

 

Nicolas

I had this problem too. It has something to do with giving Alfred permission to control the computer in Mavericks. If you try to run the script in Appklscript Editor, it will prompt you to give Alfred access. After giving permission, it works. 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...