Jump to content

Trying to make script for opening Google Chrome in incognito mode


Recommended Posts

open -a Google\ Chrome --new --args -incognito

 

Executing that in a terminal command, the problem is the app terminal is shown too.

 

Anybody knows a trick for avoid that?

 

Had an extension for V1 but seems that doesn´t exist for v2.

 

Thanks.

Edited by Tito
Link to comment

open -a Google\ Chrome --new --args -incognito

 

Executing that in a terminal command, the problem is the app terminal is shown too.

 

Anybody knows a trick for avoid that?

 

Had an extension for V1 but seems that doesn´t exist for v2.

 

Thanks.

 

To expand a bit on what nisbet suggested...

 

1. Create a new Workflow in Alfred

2. Click the + in the top right of the workflow area.

3. For a keyword to trigger click, add Input -> Keyword, for a hotkey, choose Triggers -> Hotkey.

4. Set options for the hotkey or keyword that you added and save.

5. Click the + in the top right again.

6. Choose Actions -> Run Script.

7. Leave the language as /bin/bash, in the script area, enter your script from above and save.

8. Mouse over the hotkey or keyword and a little tab should appear on the right side. Click and drag it to the action. A line should be shown between the two showing that they are connected.

 

After that, you should be ready.

Link to comment

This does not work if Chrome is already open (running in the background).

 

I was under the impression that this workflow would open a new or existing incognito window while Chrome was already running (Since Chrome is usually open in the background almost always.)

 

Does anyone know how can this be altered to make this work?

 

Thanks!

 

According to this website, the applescript to open a new chrome window is below:

 

 

on run {input, parameters}
    tell application "Google Chrome"
        activate
        delay 0.1
        make new window
    end tell
    return input
end run
Edited by jloveblaze
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...