«

»

Aug 10

GTD Capturing using AutoHotKey + GQueues

Here is a great trick to capture To Do items as you think of them by using GQueues (or your favourite GTD program), and AutoHotKey, an amazing little program that can change your life if you use Windows.

The idea: set Ctrl-Q as a global short cut on your computer that will open GQueues and open the quick entry screen.

NOTE: This is designed to work for Chrome. It will search through every Chrome window you have open, search through every tab to see if GQueues is already up. If it is, it will focus on it and activate the quick entry screen. If it’s not open already, it will open it and again open the quick entry screen. Enjoy!

The code:

;;Open GQueues and quick add new action
;;
;;R. Borgersen - 2012-02-21

#NoTrayIcon
#SingleInstance force

RunThroughChromeTabs()
{
	MouseClick, left, 196, 59

	WinGetTitle, Title, A  ;get active window title
	OrigTitle := Title       
	Loop
	{
		if(InStr(Title, "GQueues")>0)
		{
			;Found
			break ; Terminate the loop
		}
		Send ^{Tab}
		Sleep, 50
		WinGetTitle, Title, A  ;get active window title
		if(Title = OrigTitle ) 
		{
			;Match to original title, assume all seen
			break         
		}
	} 	
}

GetQGueuesUp(){
	IfWinExist, GQueues - Google Chrome,
	{
		WinWait, GQueues - Google Chrome, 
		IfWinNotActive, , , WinActivate, , 
		WinWaitActive, , 
		Send {Home}
		WinMaximize A
	}
	
	else
	{ 
		SetTitleMatchMode, 2
		
		WinGet, id, list, - Google Chrome
		Loop, %id%
		{
			this_id := id%A_Index%
			WinActivate, ahk_id %this_id%
			RunThroughChromeTabs()
			WinGetTitle, Title, A
			
			if(InStr(Title, "GQueues")>0)
			{
				;found
				Send {Home}
				break ; Terminate the loop
			}
		}

		IfWinNotExist, GQueues - Google Chrome
		{
			Run, http://www.gqueues.com/main  ;Open the site
			Sleep, 1500	; wait to ensure it has loaded (necessary?)
			WinMaximize A
		}

		WinWait, GQueues - Google Chrome, 
		IfWinNotActive, , , WinActivate, , 
		WinWaitActive, , 
	}
}

OpenQuickAddWindow(){
	MouseClick, left,  489,  139
	Sleep, 100
	Send, q
	MouseClick, left,  532,  497
	Sleep, 100
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ACTUAL MAIN STARTS HERE ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

^q::
GetQGueuesUp()
OpenQuickAddWindow()
return

Feel free to modify this if you want to use it for something else.

Rob

1 comment

  1. Dan

    For implementing GTD you can use this this application:

    http://www.Gtdagenda.com

    You can use it to manage your goals, projects and tasks, set next actions and contexts, use checklists, and a calendar.
    Syncs with Evernote and Google Calendar, and also comes with mobile version, and Android and iPhone apps.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

What is 9 + 11 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)