-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCtrl+Shift+R Resend Selected Email.ahk
61 lines (50 loc) · 2.21 KB
/
Ctrl+Shift+R Resend Selected Email.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#SingleInstance, Force ; Less annoying
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SetControlDelay -1 ; May improve reliability and reduce side effects.
SendMode, Input ; Superior speed and reliability over the default send mode.
Hotkey, IfWinActive, ahk_exe Trebuchet.App.exe
Hotkey, ^+r, ResendSelectedEmail
Return
; Ctrl + Shift + R | Resend selected email
; Click the note containing the email you want to resend, then press this hotkey.
ResendSelectedEmail:
; Wait for the user to release the modifier keys; these keys being pressed
; while the script runs will screw up the menu navigation.
KeyWait, Ctrl, L
KeyWait, Shift, L
; Click the dropdown next to the "E-mail" button and choose "Reply to all"
; This took me hours to figure out and will probably break with the next Cherwell update
WinGet, controls, ControlListHwnd, A
Loop, Parse, controls, `n
{
ControlGetText, control_text, , ahk_id %A_LoopField%
if (control_text == "Main Toolbar") {
ControlSend, , {Tab}{Left}{Left}{Left}{Left}{Enter}a, ahk_id %A_LoopField%
Break
}
}
; Wait for the email box to appear.
WinWaitActive, E-mail Message, , 10
Sleep, 125 ; Magic delay
if (ErrorLevel == 1) {
; Email box didn't show up after 10 seconds;
; play the Windows exclamation sound.
SoundPlay, *48
Return
}
; Change the "Send via" field to "S&T IT Help Desk" because of course it sets it to "UM DoIT Services" by default
; This assumes the needed value is one above the current value. If that stops being consistently true, you could
; probably use ControlGetText to find out the value selected in this box.
ControlSend, WindowsForms10.COMBOBOX.app.0.1e4013b_r6_ad12, {Up}, A
; Delete the reply information added to the top
Loop, 9 {
Send, +{Down}
}
Send, {Backspace}
; Remove "RE: " from the subject line
Send, +{Tab}{Home}{Delete}{Delete}{Delete}{Delete}
; Delete the first email address in the Recipient field (because it's your own?? Why would I want to make myself a recipient, Cherwell?)
Send, +{Tab}+{Tab}{Home}^{Delete}
; Highlight the Send button so you can just press Enter to send.
Send, {Tab}{Tab}{Tab}{Tab}{Tab}
Return