Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

GmailKeys for Outlook 2013


  • Please log in to reply
12 replies to this topic
Saibot
  • Members
  • 3 posts
  • Last active: Mar 29 2016 10:29 PM
  • Joined: 20 Feb 2014

I have updated Ty Myrick's excellent GmailKeys script to work with Outlook 2013.  This script should also work with Outlook 2010 by toggling the comment marks on the appropriate IfWinActive lines (tho I have not tested any of the new functionality in 2010).

 

 

Programatic Changes:

  • IfWinActive line now looks for "- Outlook" rather than "- Microsoft Outlook"
  • CtrlList now includes “OutlookGrid1” and “OutlookGrid2” (in addition to SUPERGRID1 and SUPERGRID2)

               

Hotkey Changes:

  • Added Delete functionality using # key (+3)
  • Added Report Spam functionality using ! key (+1)
  • Enabled folder move functionality using v key
  • Changed message flagging (starring) using s key  - now defaults to follow-up flag, rather than popping up the dialog box

 

Caveates:

  • For Archive functionality to work properly, you must set the Archive Quickstep to use Crtl+Shift+1 as the optional shortcut key.
  • For Label/Categorize functionality to work, you must add the Categorize button to the Quick Access Toolbar in the third position.
  • For Spam/Block functionality to work, you must add the Block Sender button to the Quick Access Toolbar in the fourth position.

 

Hope you like it!

;*******************************************************************************
; Information
;*******************************************************************************
; AutoHotkey Version: 3.x
; Language: English
; Platform: XP/Vista/7
; Updated by: Toby Garcia
; Previously updated by: Ty Myrick
; Author: Lowell Heddings (How-To Geek)
; URL: http://lifehacker.com/5175724/.....gmail-keys
; Original script by: Jayp
; Original URL: http://www.ocellated.com/2009/.....t-outlook/
;
; Script Function: Gmail Keys adds Gmail Shortcut Keys to Outlook
; Version 3.x updated for Outlook 2013
;
;*******************************************************************************
; Version History
;*******************************************************************************
; Version 3.1 - added delete & spam functionality and enabled move/star funcs
; Version 3.0 - updated by Toby Garcia to work with Outlook 2013
; Version 2.0 - updated by Ty Myrick to work with Outlook 2010
; Version 1.0 - updated by Lowell Heddings
; Version 0.1 - initial set of hotkeys by Jayp
;*******************************************************************************
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetTitleMatchMode 2 ;allow partial match to window titles
;************************
;Hotkeys for Outlook 2013
;************************
;As best I (Ty Myrick) can tell, the window text 'NUIDocumentWindow' is not present on 
;any other items except the main window. Also, I look for the phrase ' - Microsoft Outlook'
;in the title, which will not appear in the title (unless a user types this string into the
;subject of a message or task).
;#IfWinActive, - Microsoft Outlook ahk_class rctrl_renwnd32, NUIDocumentWindow	;for Outlook 2010, uncomment this line
#IfWinActive, - Outlook ahk_class rctrl_renwnd32, NUIDocumentWindow		;for Outlook 2013, uncomment this line
y::HandleOutlookKeys("^+1", "y") ;archive message using Quick Steps hotkey (ctrl+Shift+1)
f::HandleOutlookKeys("^f", "f") ;forwards message
r::HandleOutlookKeys("^r", "r") ;replies to message
a::HandleOutlookKeys("^+r", "a") ;reply all
v::HandleOutlookKeys("^+v", "v") ;move message box
+u::HandleOutlookKeys("^u", "+u") ;marks messages as unread
+i::HandleOutlookKeys("^q", "+i") ;marks messages as read
j::HandleOutlookKeys("{Down}", "j") ;move down in list
+j::HandleOutlookKeys("+{Down}", "+j") ;move down and select next item
k::HandleOutlookKeys("{Up}", "k") ;move up
+k::HandleOutlookKeys("+{Up}", "+k") ;move up and select next item
o::HandleOutlookKeys("^o", "o") ;open message
s::HandleOutlookKeys("{Insert}", "s") ;toggle flag (star)
; s::HandleOutlookKeys("^+g", "s") ;set follow up options (star)
c::HandleOutlookKeys("^n", "c") ;new message
/::HandleOutlookKeys("^e", "/") ;focus search box
.::HandleOutlookKeys("+{F10}", ".") ;Display context menu
l::HandleOutlookKeys("!3", "l") ;categorize message using All Categories hotkey in Quick Access Toolbar (Alt+3)
+3::HandleOutlookKeys("{Delete}", "+3") ;delete selected message(s)
+1::HandleOutlookKeys("!4", "+1") ;Mark message as spam using Block Sender hotkey in Quick Access Toolbar (Alt+4)
#IfWinActive
;Passes Outlook a special key combination for custom keystrokes or normal key value, depending on context
HandleOutlookKeys( specialKey, normalKey )
{
;Activates key only on main outlook window, not messages, tasks, contacts, etc.
;IfWinActive, - Microsoft Outlook ahk_class rctrl_renwnd32, NUIDocumentWindow, ,	;for Outlook 2010, uncomment this line
IfWinActive, - Outlook ahk_class rctrl_renwnd32, NUIDocumentWindow, ,			;for Outlook 2013, uncomment this line
{
;Find out which control in Outlook has focus
ControlGetFocus currentCtrl, A
; MsgBox, Control with focus = %currentCtrl%
;Set list of controls that should respond to specialKey. Controls are the list of emails and the main
;(and minor) controls of the reading pane, including controls when viewing certain attachments.
;Currently I handle archiving when viewing attachments of Word, Excel, Powerpoint, Text, jpgs, pdfs
;The control 'RichEdit20WPT1' (email subject line) is used extensively for inline editing. Thus it 
;had to be removed. If an email's subject has focus, it won't archive...
ctrlList = Acrobat Preview Window1,AfxWndW5,AfxWndW6,EXCEL71,MsoCommandBar1,OlkPicturePreviewer1,paneClassDC1,OutlookGrid1,OutlookGrid2,RichEdit20WPT2,RichEdit20WPT4,RichEdit20WPT5,RICHEDIT50W1,SUPERGRID2,SUPERGRID1,_WwG1
if currentCtrl in %ctrlList%
{
; MsgBox, Control in list.
Send %specialKey%
}
;Allow typing normalKey somewhere else in the main Outlook window. (Like the search field or the folder pane.)
else
{
; MsgBox, Control not in list.
Send %normalKey%
}
}
;Allow typing normalKey in another window type within Outlook, like a mail message, task, appointment, etc.
else
{
Send %normalKey%
}
}


Skrell
  • Members
  • 384 posts
  • Last active: Jul 07 2016 05:03 PM
  • Joined: 23 Aug 2011

Where is the original Gmailkeys?  I never heard of it and would like to check it out.



Saibot
  • Members
  • 3 posts
  • Last active: Mar 29 2016 10:29 PM
  • Joined: 20 Feb 2014

Where is the original Gmailkeys?  I never heard of it and would like to check it out.

 

The original script was shared in 2009.  The previous version was posted on the support forum in 2012 by Ty Myrick.



matt wilkie
  • Members
  • 5 posts
  • Last active: Jul 31 2015 08:55 AM
  • Joined: 01 Oct 2013

Thanks so much for sharing your changes!

 

Would please also post your script somewhere else also? All the whitespace seems to be stripped or changed when I copy it.  If you're not sure where, you could fork alapolloni's version on github (requires an account) https://github.com/a...ysInOutlook.ahk, or just use http://pastebin.com/ anonymously.

 

Thanks!



bwoo
  • Members
  • 2 posts
  • Last active: Jan 28 2015 04:02 PM
  • Joined: 23 Mar 2014

I'm having trouble with the script. Nothing seems to respond. How can I test what is/is not working please?

BTW .. thank you SO much for making this. This is exactly what I was looking for.

Thanks also to Lifehacker for posting it.



techie108
  • Members
  • 250 posts
  • Last active: Jul 20 2019 03:19 AM
  • Joined: 05 Aug 2012

Hi there,

 

I'd love to use this script, but it appears that the script is unable to recognize when Outlook 2010 is in its main window (instead of the compose window). the only function i need is replacing "/" with Ctrl+E to pull attention to the search box. 



techie108
  • Members
  • 250 posts
  • Last active: Jul 20 2019 03:19 AM
  • Joined: 05 Aug 2012

sorry double post



ndufault
  • Members
  • 1 posts
  • Last active: Sep 16 2014 11:18 PM
  • Joined: 16 Sep 2014

I had trouble getting this to work as well (Windows 8, Outlook 2013 32bit Office365 ProPlus install). Finally managed to get it to work with this answer at superuser.com. He recommended using SetTitleMatchMode RegEx instead of 2. I'm still playing with the script a bit but that it what finally got Outlook to respond to it. I can post if I finish but mostly just wanted to get the "y" shortcut to work so I may not develop further.

 

I'm having trouble with the script. Nothing seems to respond. How can I test what is/is not working please?

BTW .. thank you SO much for making this. This is exactly what I was looking for.

Thanks also to Lifehacker for posting it.



sac86738
  • Members
  • 2 posts
  • Last active: Jan 26 2015 05:41 PM
  • Joined: 12 Feb 2013

I'm running Windows 7 with Outlook 2013.

 

In addition to the great suggestion of changing TitleMatchMode to RegEx like so:

SetTitleMatchMode RegEx

...and updating the #IfWinActive statement to a regex that'll match the title bar of Outlook's window...

#IfWinActive Inbox.*Outlook

I also found that you need to add OutlookGrid1 to the control list, like so:

ctrlList = Acrobat Preview Window1,AfxWndW5,AfxWndW6,EXCEL71,MsoCommandBar1,OlkPicturePreviewer1,OutlookGrid1,paneClassDC1, RichEdit20WPT2,RichEdit20WPT4,RichEdit20WPT5,RICHEDIT50W1,SUPERGRID2,SUPERGRID1,_WwG1

To self-serve in the future, all you have to do is comment out the lines with MsgBox in them; this will show you which control is active and whether it's in the Control List or not. Hope this helps.

 

P.S. I found regexpal.com handy for confirming that Inbox.*Outlook would match what's in my Outlook title bar. As someone new to regex, I'm loving the flexibility but craved realtime feedback. RegExPal provides.



saynotopunx
  • Members
  • 1 posts
  • Last active: Mar 21 2015 01:59 PM
  • Joined: 31 Jan 2015

I started using AHK yesterday, and I instantly thought to myself, "how could I use AHK to make Outlook shortcuts easier?" In my job, I send and respond to hundreds of e-mails a day - Outlook is one of the primary tools I use all day long, so little things like using CTRL+SHIFT+R to Reply All were not only slightly time consuming, but also ergonomically unpleasant when I have to Reply All to every e-mail I send. Now I just use R to Reply All (as well as y to mark as read, u to mark as unread, d to delete...)

 

Bottom line, this tool saved my life. Thank you!



jackpines
  • Members
  • 1 posts
  • Last active: May 12 2015 07:30 PM
  • Joined: 10 Apr 2015

To extend on sac86738's work, I setup folders for prioritizing incoming mail. So, I want the Gmail Keys to work in them, too. Others may also use mailbox folders so I updated the RegEx to exclude non-mail folders like Contacts and Calendar. Below is that update:

#IfWinActive ^(?!.*Calendar)(?!.*To-Do List)(?!.*Contacts)\b.*Outlook.*$		;for Outlook 2013 & 2016 Preview, uncomment this line

I'm no RegEx pro but I did test this in RegExr and on my system and it appears to work correctly.

 

If anyone knows of a repo where this script is being maintained, please update this thread so I can contribute this.

 

As I'm beta testing Outlook 2016 Preview, I discovered that it appends " Preview" to the end of the window title. I updated the above accordingly.



mcd311
  • Members
  • 8 posts
  • Last active: Jan 09 2017 01:51 AM
  • Joined: 05 May 2006

Logged ion just to say thank you for updating for 2013

Was using the earlier version and updated Office and so far this works perfectly

Thumbs Up @Saibot


MCD311 from Australia

mdevey
  • Members
  • 1 posts
  • Last active: Oct 23 2015 02:19 AM
  • Joined: 22 Oct 2015

Summary: Does anyone know how to distinguish between a Draft body editing control and body reading control? - Both have ClassNN of _WwG1.

 

Hi,

 

I'm a newbie, This works really well in outlook 2013.  Except for one small problem.  

 

When I start writing reply (ClassNN is _WwG2) and then navigate away and come back to edit the [Draft] the ClassNN is now _WwG1 and all the hotkeys are still in effect.  IE I can't type y, j, k etc.

 

I can get around this by hitting 'Pop Out' the reply or removing _WwG1 from the ctrlList in the script, but that significantly reduces where the mouse can be to trigger the hotkeys.  _WwG1 is a normal body of an email - where you often put the mouse when reading/copying parts of an email.

 

I'm using Outlook 2013 15.0.4420.1017 MSO 15.0.4659.1001 32-bit if that helps.

 

Thanks!