Monday, 16 March 2015

Always open Google Chrome in Incognito: Mac

Most Chrome users use the Incognito browsing mode every now and then, while others use it quite often. If you prefer incognito browsing over normal browsing sessions (we’re not judging) but are vexed with the fact that there is no one-click method to launch Chrome in Incognito by default, you can do so with a little script. This particular method is meant to work in OS X only, as Windows users can always directly launch Chrome in Incognito mode from its Jumplist (just as Mac users can do so from the Dock icon’s options). The script is meant to launch Chrome in Incognito mode with one click using a dedicated shortcut created in form of an AppleScript app.
Open AppleScript Editor and paste the following script in it:
do shell script "open -a /Applications/Google\\ Chrome.app --args --incognito"
Save the script as an application and move it to Launchpad for easier access. If you want to be able to search and run it from Spotlight search, you should add it to the Applications folder. If you’re only ever going to use Chrome in Incognito mode, all you need to do now is to remove the app’s icon from the Launchpad and keep only this script there.
Chrome not running
This script has a little catch to it though – it won’t work if Chrome is already running. So if you’re looking for a method that will open Chrome in Incognito mode regardless of whether it’s already running in normal mode or not, open AppleScript Editor and save the following script as an application. The catch with this method is that it will close all other Chrome windows when launched.

tell application "Google Chrome"
    close windows
    make new window with properties {mode:"incognito"}
    activate
end tell
Chrome incognito
Both methods should give you an application that can be added to Launchpad, but the apps’ icons will be the default script one, and that’ll make it hard to be recognized. What you can do is modify the icon to something that is easier to identify. Find a nice PNG image, preferably one that’s small in size, that you can identify with as Chrome’s Incognito mode. Open that image in Preview and from the Edit menu, click ‘Select All’, followed by ‘Copy’. You can select the image by clicking and dragging your cursor over it, though there is a chance you might not select all of it.
Right-click the application you created using AppleScript Editor and select ‘Get Info’. In the window that opens, click the icon at the very top next to the script’s name and hit Ctrl+V. Make sure the padlock icon at the bottom right is unlocked so that the changes take effect. Enter your password if you are prompted to do so.
script icon
You now have a perfectly functioning and easily recognisable app that opens Chrome in Incognito mode.

No comments:

Post a Comment