Random Tabulator Removal in Combination with Autohotkey
-
Hello everybody,
I found a really strange behaviour when Autohotkey sends keystrokes to Notepad++.
I use quite a lot little scripts with Autohotkey to create preformed text modules with shortkeys.
e.g. i type “contact” + space and the preformed text structure
[Contact] NAME COMPANY POSITION PHONE MAIL COMMENTS
is send to my document to have placeholders to save contact information in a document.
In Autohotkey this is done with the three following lines:::contact ::
Send, [Contact]{tab}NAME{tab}COMPANY{tab}POSITION{tab}PHONE{tab}MAIL{tab}COMMENTS{tab}
returnIt works perfectly in all programms (e.g. editor, word, excel …) but in Notepad++ I use this shortkey 6 times and get 6 different outputs:
[Contact] NAME COMPANY POSITION PHONE MAIL COMMENTS
[Contact] NAMECOMPANY POSITIONPHONEMAIL COMMENTS
[Contact] NAMECOMPANYPOSITION PHONE MAILCOMMENTS
[Contact] NAMECOMPANYPOSITIONPHONE MAILCOMMENTS
[Contact] NAMECOMPANYPOSITIONPHONEMAIL Comments
[Contact] NAMECOMPANYPOSITIONPHONEMAILCOMMENTSFor the first time everything is fine but already for the second usage three tabulators are missing. in the third line one missing tabulator is there again but two others are missing. The more often I use this hotkey the less tabulators I get. More than 6 hotkeys results in just one tabulator (the first one).
Do you have any idea why this happens??
It is not dependent on the “paste” speed of Autohtokey. I added breaks of 100ms after each word and tab but still they were deleted.ps: in line 5 even the capitalization changes in the word “comments”.
Do you have any Idea what is wrong?
Thanks in advance, Jan
-
Jan H. I tried it and reproduced your results. Then I tried typing and tabbing manually which showed that after the first line Notepad++ shows a drop down menu intelli-sense type prompt which has to be dismissed by a tab or esc before another tab will be actually entered in the text.
I suggest you try the following hotstring in Notepad++
::contact ::
Send, [Contact]{esc}{tab}NAME{esc}{tab}COMPANY{esc}{tab}POSITION{esc}{tab}PHONE{esc}{tab}MAIL{esc}{tab}COMMENTS{esc}{tab}
Return -
WOW, I never expected this and really appreciate your help!
This is the solution of course!
100ms break inbetween was too less to see this popup.
Thanks a lot!
If anybody has a similar problem, I found a different workaround.
Instead of sending each keystroke after another its also possible to load the string into the clipboard and paste it in one piece.
Looks like this:::contact ::
clipboard = [Contact]tNAME
tCOMPANYtPOSITION
tPHONEtMAIL
tCOMMENTSt
r
Send, ^v
return