-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathGmail Compose.ahk
47 lines (41 loc) · 1.08 KB
/
Gmail Compose.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#SingleInstance force
SetTitleMatchMode, 2
ComposeTitle = Compose Mail -
If WinExist(ComposeTitle . " ahk_exe chrome.exe") {
WinActivate
return
}
; Loop on all Chrome Windows
WinGet, id, List,ahk_exe Chrome.exe
found := False
tabSearch = Gmail
Loop, %id%
{
hWnd := id%A_Index%
WinActivate, ahk_id %hWnd%
; Loop on all Tabs in Chrome Window
WinGetTitle, firstTabTitle, A
title := firstTabTitle
Loop {
if (InStr(title, tabSearch)>0){
found = True
break
}
Send ^{Tab} ; switch to next tab
Sleep, 50
WinGetTitle, title, A ;get active window title
if (title = firstTabTitle){
break
}
} ; end Loop Tabs
if (found)
break
} ; end loop Chrome windows
If !(found) {
Run run C:\Program Files (x86)\Google\Chrome\Application\chrome.exe https://mail.google.com/mail/ca/u/0/#inbox"
WinWait, Inbox ahk_exe Chrome.exe
}
SendInput +c ; Shift+C
;WinWait %ComposeTitle%
;winmove, A,, 1750, 303, 1725, 935; moving the window to my preferred position
return