#NoTrayIcon
; FULL PATHS HAVE TO BE PROVIDED!
; The volumes
DictPath1 = ...\Forcellini_AC.pdf
DictPath2 = ...\Forcellini_DK.pdf
DictPath3 = ...\Forcellini_LQ.pdf
DictPath4 = ...\Forcellini_RZ.pdf
; The index files
DictIndex1 = ...\Forcellini1.txt
DictIndex2 = ...\Forcellini2.txt
DictIndex3 = ...\Forcellini3.txt
DictIndex3 = ...\Forcellini4.txt
SetTitleMatchMode, 2
; creating index
PageCount = 0
Loop, Read, %DictIndex1%
PageCount++, Page%PageCount% := SubStr(A_LoopReadLine, 4, 3)+1, Word%PageCount% := SubStr(A_LoopReadLine, 8)
Loop, Read, %DictIndex2%
PageCount++, Page%PageCount% := SubStr(A_LoopReadLine, 4, 3), Word%PageCount% := SubStr(A_LoopReadLine, 8)
Loop, Read, %DictIndex3%
PageCount++, Page%PageCount% := SubStr(A_LoopReadLine, 4, 4), Word%PageCount% := SubStr(A_LoopReadLine, 9)
Loop, Read, %DictIndex4%
PageCount++, Page%PageCount% := SubStr(A_LoopReadLine, 4, 4), Word%PageCount% := SubStr(A_LoopReadLine, 9)
; creating GUI
Gui, Add, Edit, vLookup
Gui, Add, Button, Section Default, OK
Gui, Add, Button, ys gClose, Close
Gui, Show
Return
ButtonOK:
Gui, Submit, NoHide
CurrentWord = %Lookup%
GuiControl, Focus, Lookup
Gosub, OK3
Return
OK3: ; Forcellini
i = 0
Loop
{
i++
If (Word%i% >= Lookup) Or (i = PageCount)
Break
}
Clipboard := Page%i%
If (i <= 932)
{
VolumePath := DictPath1
Volume = Forcellini_AC
}
Else If (i <= 1905)
{
VolumePath := DictPath2
Volume = Forcellini_DK
}
Else If (i <= 2935)
{
VolumePath := DictPath3
Volume = Forcellini_LQ
}
Else
{
VolumePath := DictPath4
Volume = Forcellini_RZ
}
IfWinNotExist, %Volume%
Run, %VolumePath%
WinWait, %Volume%
WinActivate, %Volume%
; Edit1 for SumatraPDF
; Use the Window Spy to detect the name of the page number edit of your default PDF viewer
ControlFocus, Edit1, A
SendInput, ^{sc1E}^{sc2F}{Enter}
Return
Close:
ExitApp
return