Collection of useful AHK scripts for working with Trados

I wanted to share my full list of ahk scripts that I have collected for working with Trados.
Would welcome any suggestions or ideas for further productivity improvements!


; List of AHK scripts for working with Trados.

{ ;(1) Settings
#NoEnv
SetTitleMatchMode, 2
SetWorkingDir %A_ScriptDir%
SetNumlockState, AlwaysOn ;Keep number lock on
SetCapsLockState, AlwaysOff ;Keep caps lock off
SetScrollLockState, AlwaysOff ;Keep scroll lock off
}

{ ;(2) Quick confirm mutiple segments. Position the mouse over a Trados segment number to use.
^t::
MouseClick, right
sleep, 50
SendInput, {down 3} ;Select the 3rd item in the right click pop-up menu accessed by right-clicking a segment number
SendInput, {right}
SendInput, {down 2} ;Change "2" to another to select a different status from the submenu
SendInput, {Enter}
return
}

{ ;(3) Symbols (See en.wikipedia.org/.../List_of_Unicode_characters to create others)
^+c::sendInput, °C
^+d::sendInput,{U+2300} ;Diameter symbol
^!+0::sendInput, {U+00B0} ;°
^+x::sendInput, {U+00D7} ;×
^+o::sendInput, {U+03A9} ;Ω
^+u::sendInput, {U+03BC} ;μ
^+2::sendInput, {U+201C} ;“
^!2::sendInput, {U+201D} ;”
NumpadMult::sendInput, {U+2022} ;Bullet point
}

{ ;(4) Trados shortcuts
RCtrl::^!down                                     ;Quickplace Tags
NumpadDiv::SendInput, ^{insert}       ;Insert source
NumpadAdd::+F3                               ;Toggle capitals
F2::^!F6                                              ;Reset filter. Together with this, it is highly recommended to install the Community Advanced Display Filter and set the keyboard shortcut for "CADF-Selection filter" to F1 (remove the Help Topics F1 shortcut first)

^Enter::
NumpadEnter::
Sendinput, ^{Enter}
Mousemove, 3900,2150 ; Move the mouse cursor out of the way upon confirm
return
}

{ ;(5) NumpadAdd Sentence case
^NumpadAdd::
MinorWords := "a,an,and,also,are,as,at,but,by,for,from,in,is,it,of,on,or,out,the,to,with,nor,so,into"
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
}

{ ;(6) F4 Google search on selection
F4::
Send, ^c
Sleep 50
Run, www.google.com/search
return
}

{ ;(7) F5 Text to speech on selection
F5::
clipboard := ""
sleep, 50
sendInput, ^c
sleep, 50
voice := ComObjCreate("SAPI.SpVoice")
voice.Voice := voice.GetVoices().Item(0) ;Change the item number here to choose which voice to use (See control panel, ease of access to see which voices you have installed on your computer)
voice.Rate :=-1 ;make the speech a little slower. This can be changed between -10 and 10.
voice.Speak(clipboard)
return
}

Parents Reply Children
No Data