Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to be able to open a new Chrome window from LaunchBar, which means I have to express the action as an AppleScript or as a shell script / executable program. I tried automator, but it doesn't really work.

So - is it possible? I tried using applescript but things like "make new window at front" don't work...

share|improve this question
    
To be clear - the question was asked when Chrome's support for AppleScript was weaker. Now it's easy to do. –  Michał Bendowski May 13 '11 at 13:40

3 Answers 3

up vote 7 down vote accepted
tell application "/Applications/Google Chrome.app"
    make new window
    activate
end tell
share|improve this answer
    
You can actually use just 'application "Google Chrome"'. –  Michał Bendowski May 13 '11 at 13:39
    
I had first used 'application "Google Chrome"', but that would activate the Parallels/Windows version of Google Chrome. Specifying the full path was the easiest solution of the ones I found. –  kipkoan May 17 '11 at 18:08
    
Your answer always saves me everytime I reformat my Mac. =p Thanks again. –  ShaChris23 May 13 '12 at 9:44

At present the AppleScript support in Chrome is very limited (beyond the standard GUI scripting native to Mac OS X) but is expected to improve in Milestone 5. (Release date unsure) See http://code.google.com/p/chromium/issues/detail?id=27468 for more details.

So at present there is no way to reliably create a new window if Chrome is already running. If it's not running it's easy to use:

tell application "Chrome"
    activate
end tell

or

open /Applications/Chrome.app

Of note running:

open /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome "URL HERE"&

is a great way to get multiple instances of the application running making clobbering your preferences and caches really easy. I don't suggest using this.

share|improve this answer

This AppleScript kind-of works, but it may not open in your current space. :(

I used to open a new Terminal window with a similar version with shortcut keys mapped by FastScripts.

tell application "Chromium" to activate

tell application "System Events"
 tell process "Chromium"
  click menu item "새 창" of menu "파일" of menu bar 1
 end tell
end tell

You should substitute "새 창" and "파일" above with your language's menu labels, and "Chromimum" with "Chrome" if you're not using a snapshot like me.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.