Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Quickly open a new Chrome tab/window from anywhere Web Browsers
If you're a Google Chrome user, you may like its Omnibar because it allows you to instantly search the web and leverage your URL history at the same time. This hint explains how to instantly get to an Omnibar from within any application.

You need two things for this hint: An AppleScript and a hotkey manager. For the hotkey manager I use Quicksilver but anything that allows you to run AppleScripts or applications on a keystroke is fine.

For the script, open AppleScript Editor and save the following code as a script (or an application if you're going to run it as an application), for example calling it Open Omnibar.
tell application "Google Chrome"
  if (count of windows) is 0 or front window is not visible then
    make new window
  else
    make new tab at end of tabs of front window
  end if
  activate
end tell
What this code does is first it checks if any Chrome windows are visible, if not it opens a new window. If a window is visible you get a new tab. Chrome automatically places the cursor in the Omnibar.

So if you assign this script to a hotkey, you can simply hit the hotkey and when you see the Omnibar, start typing.

[crarko adds: I haven't tested this one. If you're running Snow Leopard you could probably set this up as an Automator Service that runs the script.]
    •    
  • Currently 3.33 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[5,668 views]  

Quickly open a new Chrome tab/window from anywhere | 3 comments | Create New Account
Click here to return to the 'Quickly open a new Chrome tab/window from anywhere' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Quickly open a new Chrome tab/window from anywhere
Authored by: HappyJoe on Jul 05, '11 04:32:39AM

Copied it to Applescript Editor and saved as an app. Worked as expected except it forced 'omnibar.app' into the Omnibar address space, with a resulting 'Oops!' message.

Can it be made to just open as hoped for?



[ Reply to This | # ]
Quickly open a new Chrome tab/window from anywhere
Authored by: Lri on Jul 06, '11 01:51:12AM
A similar script for Safari:
tell application "Safari"
	activate
	reopen -- opens a browser window if there's no existing one
	tell (window 1 where (its document is not missing value))
		if name of its document is not "Untitled" then set current tab to (make new tab)
		set index to 1
	end tell
end tell
tell application "System Events" to tell process "Safari"
	perform action "AXRaise" of window 1 -- `set index` doesn't always raise the window
	-- keystroke "f" using {option down, command down}
end tell


[ Reply to This | # ]
Quickly open a new Chrome tab/window from anywhere
Authored by: norz on Nov 12, '11 01:29:01PM

I've been searching for a long time how to built a global keyboard shortcut to open a new Chrome window, thank you very much! :)



[ Reply to This | # ]