Skip to content

Instantly share code, notes, and snippets.

@ryansmccoy
Created November 11, 2020 22:51
Show Gist options
  • Save ryansmccoy/ea1a9d951616f1cce1eb57d3adb02dd6 to your computer and use it in GitHub Desktop.
Save ryansmccoy/ea1a9d951616f1cce1eb57d3adb02dd6 to your computer and use it in GitHub Desktop.
shortcuts.ahk
#SingleInstance force
$RButton::
Send {RButton}
Return
RButton & WheelUp::WinMaximize,a
RButton & WheelDOWN::WinRestore,a
Return
:R*?:xxx::
FormatTime, CurrentDateTime,, yyyyMMdd
SendInput %CurrentDateTime%
return
:R*?:ccc::
FormatTime, CurrentDateTime,, MM-dd-yy
SendInput %CurrentDateTime%
return
:R*?:vvv::
FormatTime, CurrentDateTime,, yyMMdd-HHmmss
SendInput %CurrentDateTime%
return
^!k::
clipboard:= clipboardAll
clipboard:= RegExReplace(clipboard,"[\\/:*?""<>|]")
clipboard := RegExReplace(clipboard,"`am)^.*\\")
Send ^v
return
^!i::
clipboard:= ClipboardAll
clipboard:=RegExReplace(clipboard, "[\W_]+", " ")
Send ^v
return
^l:: ; Convert text to lower
StringLower Clipboard, Clipboard
Send %Clipboard%
RETURN
^!9::
clipboard:= ClipboardAll
clipboard:=RegExReplace(clipboard,"[^[:ascii:]]")
Send ^v
return
^!u:: ; Convert text to upper
StringUpper Clipboard, Clipboard
Send %Clipboard%
RETURN
#IfWinActive, HiEditor - D:\Documents\AutoHotkey.ahk
~^s::
Sleep 500
reload
return
#IfWinActive
Return
#z:: Run, "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE" /c ipm.note
return
;;;THIS RUN WILL PUT john doe in the TO and PUT LetterJob Process IN SUBJECT LINE AND Complete IN THE BODY OF E-MAIL
#g::
emailadd = ";"
IfInString, emailadd,;
{
epos := InStr(emailadd,";",CaseSensitive = false, StartingPos = 1)
eLength := StrLen(emailadd) - epos
StringTrimRight, emailadd, emailadd, % eLength + 1
}
FormatTime, CurrentDateTime,, MM-dd-yy
Run, C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE /c ipm.note /c "testsb.txt" /m %emailadd%&subject=%CurrentDateTime%`%20Earnings&body=
return
#Persistent
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;Define hot key: control alt V
^!m::
;Get clipboard text
orig := clipboard
; Note for following code that `r`n = newline
;Remove a dash followed by newline, since that's probably a single word across a linebreak
StringReplace clipboard, clipboard, -`r`n, , All
;Replace a single newline with a space
StringReplace clipboard, clipboard, %A_Space% `r`n, %A_Space%, All
StringReplace clipboard, clipboard, `r`n, %A_Space%, All
;Comma followed by newline --> comma followed by space
StringReplace clipboard, clipboard, "," . `r`n, "," . %A_Space%, All
;Replace multiple adjacent spaces with a single one
clipboard := RegExReplace(clipboard, "\s+" , " ")
Send ^v ;paste
sleep 100
clipboard := orig ; return clipboard to original state
; To do
; double line break --> leave alone as intentional new paragraph
return
#Persistent
#SingleInstance, Force
#NoEnv
SetBatchLines, -1
SetWorkingDir, %A_ScriptDir%
SendMode, Input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment