The original script is a collection of functions that let me import textes and images in a Publisher doc from another document in Word or Publisher.
Capslockstate is a good way to use the same hotkey, telling the script what source to use.
The first 3 lines are in the original script.
I tried to add #InstallKeybdHook, several combinations of #If or If and other subtleties but got no success.
Where is my mistake?
Code: Select all
#SingleInstance Force
#NoEnv
SendMode Input
F18::
If (GetKeyState("CapsLock", "T")) OR (WinActive("ahk_class OpusApp")) {
MsgBox readingPOSWRD(1)
Return
} else {
MsgBox readingPOSPUB(1)
Return
}