Multiple Gmail Accounts

with AutoHotkey

by Philippe Lamarre
last updated June 16, 2014
difficulty.png Intermediate

by Philippe Lamarre


If you are a Gmail user, you might have multiple Gmail accounts. What does this mean ? It means a long process when you want to switch from an account to another.

But what if you could, in less than 5 seconds, go from your professional account to your personal one without disrupting your workflow ?

When you integrate the URL ( ) in an AutoHotkey script, it becomes easy to flip flop between different adresses.

Note: AutoHotkey has no limits when it comes to automation in Windows, but for many users who may only need simple keyboard shortcuts, installing and learning AutoHotkey, and keeping up to date, can be overkill. ShortKeeper can be used (with and without an Enterpad) to manage an AutoHotkey-based system in a way most non-programmers will find remarkably user-friendly and and effective [learn more].

Here is how the script with this URL looks like.



overlay-um-date.gifPrepare your overlay
Choose free keys on the Enterpad to use your Gmail accounts.
Name it something relevant. This example uses Gmail Work and Gmail Personal.



Code installation

Copy/paste the following script in your AutoHotkey script template ( Enterpad.ahk ) at the chosen key location.

ie := ComObjCreate("InternetExplorer.Application")
 ie.Visible := true

 while ie.readyState != 4 || ie.document.readyState != "complete" || ie.busy
 Sleep, 100

 while ie.readyState != 4 || ie.document.readyState != "complete" || ie.busy
 Sleep, 100

ie.document.getElementById("Passwd").value := "Type your password here"




More Info

Take note here that it works with Internet Explorer only. Where you read “choose-account-0″, you have to replace 0 by 1 if you want to set your second account and by 2 to set your third account and so on. Where you read “Type your password here”, you have to put your account password.

If ever your script does not work anymore, make sure you come back here and see if the coding did not change. It can be possible that Google changes an ID and your script will stop working. It's been six months we are using it and nothing has changed and it works perfectly.