Also with ControlSend I unable to give shortcut key(ie. {Appskey}P) to onenote
Code: Select all
;Copy and Cut
NumpadSub::
If (KeyPressCount > 0)
{
KeyPressCount +=1
}
else
{
KeyPressCount :=1
}
if (KeyPressCount <4)
{
Tooltip, % KeyPressCount
}
SetTimer, vKeyPressMonitor, 550
return
vKeyPressMonitor:
If (KeyPressCount = 1)
{
SendInput, ^c
ToolTip, Copy
Sleep 400
}
else if (KeyPressCount = 2)
{
SendInput, ^x
ToolTip, Cut
Sleep 400
}
else if (KeyPressCount > 2) ;copy link to paragraph part
{
#IfWinActive ahk_class Framework::CFrame ahk_exe ONENOTE.EXE
ControlSend,, {AppsKey}{p}, ahk_exe ONENOTE.EXE
ToolTip, Copy Link to Paragraph(OneNote)
Sleep 400
#IfWinActive
}
KeyPressCount := 0
SetTimer, vKeyPressMonitor, Off
Tooltip,
return
Where is below is the portion of script where I am having problem:
Code: Select all
else if (KeyPressCount > 2) ;copy link to paragraph part
{
#IfWinActive ahk_class Framework::CFrame ahk_exe ONENOTE.EXE
ControlSend,, {AppsKey}{p}, ahk_exe ONENOTE.EXE
ToolTip, Copy Link to Paragraph(OneNote)
Sleep 400
#IfWinActive
}