AutoHotkey: My best codes for translators and lawyers

This is a list of AutoHotkey shortcuts that I find useful. You can learn more about AutoHotkey in my Introduction to AutoHotkey.

I also recommend Paul Filkin’s article, the AutoHotkey website, and the forum for SDL Trados scripts.

To add your AutoHotkey file to Windows start-up and so that it starts each time you switch on your computer, follow this link.

Quick links

SendMode Input
<^>!d:: Run, C:\Users\[User name]\Downloads
<^>!c:: Run, https://calendar.google.com/calendar/
<^>!t:: Run, https://twitter.com/

Text expanders

<^>!;:: Send, ñ
<^>!+;:: Send, Ñ
:*:@@::Richard@Contractually-Speaking.co.uk
:*:rrll::Richard Lackey
:*:ccss::Contractually Speaking Ltd.

For translations of PDF documents:
::rrr::[Redacted]
::bbb::[Barcode]
::sss::[Signature]
::iiss::[Illegible stamp]
::iill::[Illegible]
::sstt::[Stamp:]

Open programs

C:: Run Calc.exe ; OPEN CALCULATOR

s:: Run, %windir%\system32\SnippingTool.exe ; OPEN SNIPPING TOOL

<^>!h:: ;EDIT AUTOHOTKEY FILE
Run, C:\Windows\Notepad.exe “[FILE LOCATION]\AutoHotkey file.ahk”

Trados tricks

<^>!n:: ;STUDIO – ADD COMMENT “CHECK LATER”
Send, ^+n
Sleep 200
Send, Check later
Send, {Enter}
Return

<^>!s:: ;STUDIO – MERGE WITH NEXT SEGMENT
Send !{Space}
Send !{Down}
Send !{Space}
Send ^!s
Return

Other functions

:R*?:ddd:: ;INSERT SHORT DATE E.G. 05/07/2019
FormatTime, CurrentDateTime,, dd/MM/yy
SendInput %CurrentDateTime%
Return

:R*?:ssdd:: ;INSERT DATE FORMAT AS 5 July 2019
FormatTime, CurrentDateTime,, d MMMMMMMMM yyyy
SendInput %CurrentDateTime%
Return

<^>!m:: ; MINIMISE CHROME
WinGet nChromeWindows, Count, ahk_class Chrome_WidgetWin_1
WinMinimize ahk_class Chrome_WidgetWin_1
Return

<^>!+m:: ; RE-OPEN CHROME
WinRestore, ahk_class Chrome_WidgetWin_1
Winactivate, ahk_class Chrome_WidgetWin_1
WinMaximize, ahk_class Chrome_WidgetWin_1
Return

!Right:: ;MOVE WORD TO RIGHT
Send, ^{Right}+^{Left}
Send, ^x
Send, ^{Right}
Send, ^v
Send, ^{Left}
Return

!Left:: ;MOVE WORD TO LEFT
Send, ^{Right}+^{Left}
Send, ^x
Send, ^{Left}
Send, ^v
Send, ^{Left}
Return

<^>!/:: ;COPY TEXT FROM ONE APP TO ANOTHER AND PASTE – ALTGR /
Send, ^c
Send, !{Tab}
Sleep 200
Send, ^v
Send, {Enter}
Return

^+F3::
; written by Steven Marzuola, May 2015. This is to remove initial caps from list of minor words below, after toggling selected text with F3.
; as written, is called using Ctrl-F3

{
MinorWords := "a,an,and,also,this,that,these,those,are,as,at,be,but,by,de,for,from,in,is,it,of,on,or,out,the,to,with,nor,so,of"
MajorWords := Format ( "{:Us}", "I,II, III,IV,V,VI,VII,VIII,IX,X,XI,XII,XIII,XIV,XV,XVI,XVII,XVIII,XIX,XX,XXI,XXII,XXIII,XXIV,XXV,XXVI,XXVII,XXVIII,XXIX,XXX,XXXI,XXXII,XXXIII,XXXIV,XXXV,XXXVI,XXXVII,XXXVIII,XXXIX,XL" )

Clipboard =
SendInput, ^c
Clipwait
rString := ""

string := StrReplace(ClipBoard, "-", " - ")
string := StrReplace(string, "/", " / ")
string := StrReplace(string, "&", " & ")
string :=  Format( "{:Ts}", string )
wordList := StrSplit( string, " " )
for each, word in wordList
{
    if( each > 1 and each < wordList.MaxIndex() )
        if word in %MinorWords%
            word := Format( "{:Ls}", word )
        if word in %MajorWords%
            word := Format( "{:Us}", word )
    rString .= word . " "
}
string := SubStr( rString, 1, -1 )
string := StrReplace(string, " / ", "/")
string := StrReplace(string, " - ", "-")
string := StrReplace(string, " & ", "&")
string := StrReplace(string, "  ", " ")
Clipboard := % string
Clipwait
SendInput, ^v
return
}