1. Home
  2. Mac OS X
  3. Force google chrome to open in incognito mode using applescript

How To Force Google Chrome For Mac To Open In Incognito Mode

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 recognizable app that opens Chrome in Incognito mode.

13 Comments

  1. Script works great (first one) on OS X 10.15.3 Catalina. Thank you. Blows my mind that Google doesn’t have an option in the program to do this. Firefox does.

  2. What a bunch of garbage. In Firefox all you have to do is set your history to ‘never save’ and you’re done.

    • The topic focuses on Chrome, not Firefox. Different program from a different company. It’s not garbage; it’s the way it works for the original topic.

  3. I don’t know if it works for all versions of chrome but I deleted the “close windows” in the second script and it works fine without your other tabs closing.

  4. The script posted by Felix will work. Anyway, it will not focus on Chrome. To make it work with Chrome already open and without closing any window, the second script should be used but without the “close windows” line:

    tell application “Google Chrome”
    make new window with properties {mode:”incognito”}
    activate
    end tell

  5. The script posted by Felix will work. Anyway, it will not focus on Chrome. To make it work with Chrome already open and without closing any window, the second script should be used but without the “close windows” line:

    tell application “Google Chrome”
    make new window with properties {mode:”incognito”}
    activate
    end tell

  6. Put –new before –args in the first version and it works with Chrome already open.

    “`
    do shell script “open -a Google\ Chrome –new –args –incognito”

    “`

  7. Is there a way to add a line to the script to open a default webpage? Any help with that would be appreciated. Thanks!

  8. This is great and just what I wanted to do. Now, how can this be set as default browser so that when a link is clicked on, in say an email, chrome will use this application to open in incognito?

  9. Thanks user3936 and Lyken for the original concepts (and code) at How do I open Google Chrome in Incognito mode by default

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.