Autohotkey: gmail & drive shortcuts keys

Luis Diaz
Luis Diaz used Ask the Experts™
on
Hello experts,
I frequently use gmail and google drive.
I was wondering how to set up some ahk which are not part of default shortcuts keyboard proposed.
1)      Be able to download a document on drive
The following combination works but I don't know if there is an smart way to do this: {Shift}+{F10 }+ {Arrow up 2}+{Enter}
2)      Be able to download an attached file from gmail:
The following combination works but I don't know if there is an smart way
3)      Be able to attach a file when composing a new e-mail
The following combination works but I don't know if there is an smart way to do this: {Tab 7}+{Enter}
4)      Be able to open received message in a new windows
Thank you for your help.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Duncan RoeSoftware Developer

Commented:
You might like to look at crikey http://www.shallowsky.com/software/crikey/
Luis DiazIT consultant

Author

Commented:
Hello Duncan,
Thank you for your comment as previous question. I am not using Linux, I am using W10.
question 29157425
I want to achieve this through AutoHotkey.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Hi Luis,

> 1) Be able to download a document on drive

How do you want to specify the document? What I'm not understanding here is how you want to improve this. It's already just two mouse clicks...right-click on the file, then left-click on Download. How do you want it to be better/faster?

> 2) Be able to download an attached file from gmail

Once again, how do you want it to be better/faster? It is currently two mouse clicks: left-click on the email to open it, then hover on the attachment and click the Download icon.

> 3) Be able to attach a file when composing a new e-mail

For a third time, how do you want it to be better/faster? Currently, all you have to do is drag-and-drop it into the Compose window.

> 4) Be able to open received message in a new windows

For the last time, how do you want it to be better/faster? Currently, it is two mouse clicks: right-click on the email, then left-click "Open in new window".

As you know, I'm a huge AutoHotkey fan for Windows automation, but it strikes me that all of these tasks are already very easy to do...not time-consuming...not very amenable to improvement by automation...unless I'm missing something. Regards, Joe
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Luis DiazIT consultant

Author

Commented:
Joe, Thank you for your feedback:
Concerning your questions:
1) Drive propose a drown down list when I am on the file and I heat F10:
2019-09-12_00h04_38.pngSo if we made a condition with winactive based on file name which contains Drive there is a potential gain of time
The idea is to send: {F10} {Up Arrow 2} {Enter} if Winactive related to Drive is active:
2019-09-12_00h08_56.png2) Ok I drop it. You are right.
3) I am accustom to use Outlook at work and I attached files regularly  with the following default combination: Alt + H + B + A.
I want to avoid mouse clicking if attaching a file can be performed with keys.
2019-09-12_00h12_46.pngPossible to simulate a mouse click based on name button?
4) Ok I will drop it.
To be honest with you I hate to use the mouse. This is why I try to replace most of mouse actions with the keyboard.
Thank you for your help.
Developer
Fellow 2017
Most Valuable Expert 2018
Commented:
I'm a big fan of the keyboard, too. In the programs that I write, all features are available via keyboard access/shortcut keys. It gets difficult sometimes to make sure that all the keys are unique, but I always make the effort to do so (it is required here in the U.S. for compliance with the federal government's Section 508 of the Rehabilitation Act).

Anyway, I rarely use Google Drive and never use the Gmail portal (I use the Gmail servers, but via the Thunderbird email client), so I'm not familiar with them. I'd be surprised if they don't support keyboard access/shortcut keys, but I guess you're saying that's the case.

OK, I just tried Google Drive in both Chrome and Firefox. Hitting F10 when I have a file selected does nothing here...I need to right-click to get the context menu that you posted. Anyway, at that point, two Up arrows and Enter do work to perform the Download. Here's AutoHotkey code that tests for the window Title and sends F10 (for you - active below) or right-click (for me - commented out below) followed by two Up arrows and Enter:

WinGetActiveTitle,Title
If (InStr(Title,"My Drive - Google Drive"))
{
  Send {F10} ; this does not work here
  ; MouseClick,Right ; this does
  Sleep,50 ;
  Send {Up 2}{Enter}
}
Else
  MsgBox,4144,Error,Google Drive is not the active window
Return

Open in new window

Tested here and it works fine in Chrome, but only with the right-click code, not F10.

Regarding #3, the attachment access/shortcut key in Gmail is Ctrl+o (that's the letter "O", not a zero). Simply do that and you'll have the Browse dialog.

Regards, Joe
Luis DiazIT consultant

Author

Commented:
Thank you Joe, I will test it and keep you informed.
Luis DiazIT consultant

Author

Commented:
Hi Joe,
I tested last proposal and I think that a ")" is missing at the end of the If line:
If (InStr(Title,"My Drive - Google Drive"))
I reviewed but I don't know why I got the following2019-09-13_06h02_03.pngIf windows attributes are the following:
2019-09-13_06h02_52.pngConcerning #3 shortcut proposed: ctrl + o. Open a windows explorer in which I select the file, however when I select the file. I got the file displayed (E.g: a png file) instead of having the attachement uploaded into the body e-mail.
After-heating-ctr-o.pngInstead of having:
2019-09-13_06h16_00.pngThank you for your help.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
> I tested last proposal and I think that a ")" is missing at the end of the If line

Correct...sorry about that...copy/paste error...obviously it was right here, otherwise I would have gotten a syntax error from the AutoHotkey interpreter (I just fixed it in the posted code).

> I reviewed but I don't know why I got the following

It's because your title doesn't contain this:

My Drive - Google Drive

It contains this:

Google Drive

Change the IF test to this:

If (InStr(Title,"Google Drive"))

> when I select the file. I got the file displayed

Can't help you with that. I never use the Gmail portal. I know you prefer the keyboard to the mouse, but in this case, one click on the paperclip icon will do it. Regards, Joe
Luis DiazIT consultant

Author

Commented:
Thank you very much for your comment Joe.
I will review Google Drive shortcut and let you know soon.
Luis DiazIT consultant

Author

Commented:
Joe,
After a some attempts, I realized that the best is to keep it as is and display the dropdrown list through F10 and send Tab 2+Enter.
The number of shortcut keys combination available in my AutoHotkey file is shrinking so I prefer to not assign to this flow as I can perform this actions directly through: Shift+F10+Tab 2+Enter.
Thank you for your help.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Hi Luis,
I think that's an excellent decision! Regards, Joe

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial