^+i::
if WinExist("ahk_class Chrome_WindowImpl_0")
{
WinActivate
ControlFocus, Chrome_AutocompleteEditView1
}
else
Run "C:\Users\vleeshue\AppData\Local\Google\Chrome\Application\chrome.exe"
return
Should do the trick
("Chrome_AutocompleteEditView1" is the name of the omnibar control, so you could add Send ^a
to select all)
Note: To get the ahk_class
for your version of Chrome, e.g., ahk_class Chrome_WindowImp1-0
, use the AU3_Spy.exe
inside the autohotkey directory. This will allow you to find the correct ahk class for your chrome browser if the example one doesn't work.
Update: I can't reproduce, maybe it will be better with another control...
To have a list of a window controls I use this code:
#Persistent
SetTimer, WatchCursor, 100
return
WatchCursor:
MouseGetPos, , , id, control
WinGetTitle, title, ahk_id %id%
WinGetClass, class, ahk_id %id%
WinGet, ControlList, ControlList, A
ToolTip, Under Cursor:`nahk_id: %id%`nahk_class: %class%`nTitle:%title%`nControl: %control%`n`nWindow Control List:`n%ControlList%
return
So the controls of my google chrome 4.0.249.78 beta (36714) are:
- ViewsTextfieldEdit1
- Chrome_RenderWidgetHostWND1
- Chrome_AutocompleteEditView1
- Chrome_WindowImpl_01
- Chrome_WindowImpl_02
I can not solve your problem directly, but I have the best workaround possible.
You can also create desktop shortcuts for other websites and apps you regularly use, even if they're not installed from the Chrome Web Store. Follow these steps:
- Click the wrench icon on the browser toolbar.
- Select Tools.
- Select Create application shortcuts.
- In the dialog that appears, choose where you'd like the shortcuts to be placed on your computer.
- Click Create.
-this guide to creating Application shortcuts
has been copied from Google's support pages.
Here is what your looking for...
- Right click on the shortcut or menu item you use to start the program.
- Now, click on properties.
- Note the item labeled Run that's set to "Normal Window". Change that to "Maximized".
After this is done, you can drag and drop the shortcut to the start menu or taskbar and you should be fine. I tried this with Windows Vista, and it worked great. I see no reason why this shouldn't work for Windows 7
Best Answer
What you can do is create multiple profiles. This means that windows will not be shared, and likewise with favorites, cache, home-screen content, cookies, etc., but you'll be able to make your shortcut work the way you wanted it to.
First, follow the steps in this article here to create a secondary profile for Google Chrome: Create Separate Profiles in Google Chrome for Family Members and Stay Extra Safe.
Secondly, modify the shortcut by tucking on your
--user-agent
parameter. For instance, here's the command line I used to test:Now you can double-click on your regular Chrome shortcut, and this new shortcut, and each will open their windows in distinct sessions, with their own user agents.