"Error: Duplicate hotkey" when hotkey is not duplicate

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hotkeyuser1234
Posts: 92
Joined: 07 Mar 2020, 12:27

"Error: Duplicate hotkey" when hotkey is not duplicate

30 Jun 2020, 16:18

Dear community,

whenever I autostart my script along the Windows boot, I get following error message:
Error Autohotkey.jpg
Error Autohotkey.jpg (10.26 KiB) Viewed 2629 times
However, in line 84 I do not have "NumpadRight", I actually don't have it anywhere in the code. Below you can see my complete code, with the private information removed (they did not contain it and please scroll down a bit). Do you know any other reasons why this error could appear?

This should be line 84:

Code: Select all

NumpadLeft::Run, Chrome.exe "https://todoist.com/"

Code: Select all

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

^,::Send <
^.::Send >

Capslock & v:: ; Caplock v;CTRL+SHIFT+V
ClipSaved := ClipboardAll ;save original clipboard contents
clipboard = %clipboard% ;remove formatting
Send ^v ;send the Ctrl+V command
Clipboard := ClipSaved ;restore the original clipboard contents
ClipSaved = ;clear the variable
Return

;Puts the current windows on 80% width and opens notepad on the right of window: CONTROL+Shift+1
^+1::
DetectHiddenWindows,on
SetWinDelay,0
F1::
Keywait,F1
WinGetPos,,,,H,AHK_class Shell_TrayWnd
WinGet,ID,ID,A
WinGet,Size,MinMax,A
If Size = 1
WinRestore,A
WinMove,A,,-8,-8,% A_ScreenWidth - ((A_ScreenWidth * 20) / 100),% 16 + A_ScreenHeight - H
WinGetPos,X,Y,W,H,A
Run,C:\Windows\System32\notepad.exe,,Hide,PID
WinWait,ahk_pid %PID%
WinMove,ahk_pid %PID%,,% A_ScreenWidth,% Y + 2,% A_ScreenWidth - W + 28,% H + 2
WinShow,ahk_pid %PID%
; WinMove,ahk_pid %PID%,,% W - 21,% Y + 2,% A_ScreenWidth - W + 28,% H + 2
;-------- Remove this part if you don't want the animation and uncomment the line above
M := A_ScreenWidth
Loop
{
M -= 100
If (M < W - 21)
Break
WinMove,ahk_pid %PID%,,% M
Sleep,10
}
; ----------------------
WinActivate,ahk_pid %PID%
WinWaitClose,ahk_pid %PID%
WinMaximize,ahk_id %ID%
Return

;NumpadIns::Run, Chrome.exe "http://www.freecollocation.com/search?word="
NumpadIns::
IF !WinActive("ahk_exe Chrome.exe")
    Run, Chrome.exe "http://www.freecollocation.com/search?word="
Else
{ ;open the website in the current tab
    SetKeyDelay, 200
    Send, ^l^a
    SendInput, http://www.freecollocation.com/search?word=
    Send, {Return}
}
Return

NumpadDown::Run, Chrome.exe "https://web.whatsapp.com/"
; 4:
NumpadLeft::Run, Chrome.exe "https://todoist.com/"

NumpadClear:: ;5 on NumPad
send ^c
ClipWait,2
Clipboard := StrReplace(Clipboard, " ", "%20")
Run, Chrome.exe "https://www.google.com/search?q="%Clipboard%
return

NumpadHome:: ;7 on NumPad
myPath := "C:\Users\Alexa\hotkeys.ahk"
SplitPath, myPath,,,,fName 
Run,% "notepad.exe " . myPath
If WinExist(fName)
    WinActivate 
Return

NumpadUp:: ; 8 on NumPad; opens the currently selected link in Chrome
send ^c
ClipWait,2
Run, Chrome.exe %Clipboard%
return

Numpad9::Run, Chrome.exe "https://www.linguee.de/deutsch-englisch/search?source=auto&query=" ; don't use 1 to keep this free for end ;9 on NumPad

;Use keyboard for arrows:
Capslock & j::Send {Left}
Capslock & i::Send {Up}
Capslock & k::Send {Down}
Capslock & l::Send {Right}

;Align elements in PowerPoint by CTRL+Shift+l/r/u/d keys:
#IfWinActive, ahk_exe POWERPNT.EXE
^!l::Send, !jdaal
^!r::Send, !jdaar
^!u::Send, !jdaat
^!d::Send, !jdaab

;^!right::
;ppt := ComObjActive("PowerPoint.Application")
;ppt.ActiveWindow.Selection.ShapeRange.Align(2, 0)
;Return

;^!left::
;ppt := ComObjActive("PowerPoint.Application")
;ppt.ActiveWindow.Selection.ShapeRange.Align(0, 0)
;Return

HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: "Error: Duplicate hotkey" when hotkey is not duplicate

30 Jun 2020, 19:31

Do you get the error message when you run the code manually?
What AutoHotkey version are you using MsgBox % A_AhkVersion?
hotkeyuser1234
Posts: 92
Joined: 07 Mar 2020, 12:27

Re: "Error: Duplicate hotkey" when hotkey is not duplicate

02 Jul 2020, 15:25

I do not get the error when I start the script manually.

I use version: v1.1.32.00

It would be great if you could help me!
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: "Error: Duplicate hotkey" when hotkey is not duplicate

02 Jul 2020, 16:01

Check the command line parameters for AutoHotkey.exe in Taskmanager after reboot, obviously there is another script started automatically, also check autostart folder in C:\Users\YOUR_USER_NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
hotkeyuser1234
Posts: 92
Joined: 07 Mar 2020, 12:27

Re: "Error: Duplicate hotkey" when hotkey is not duplicate

04 Jul 2020, 08:25

I am not sure how I can check the parameters in Task manager. Could you explain that to me? In folder "C:\Users\Alexa\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" I have the hotkeys.ahk file which is automatically started
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: "Error: Duplicate hotkey" when hotkey is not duplicate

04 Jul 2020, 09:02

In task manager, add column "command line parameters" in tab details!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, Google [Bot], jameswrightesq, Joey5, mikeyww, RandomBoy, wpulford and 306 guests