How do I send a text Hotkey to a Notepad++ window

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jwinfl
Posts: 89
Joined: 16 Aug 2017, 12:37

How do I send a text Hotkey to a Notepad++ window

16 Sep 2018, 07:51

I have a text hot key ::qqhdg:: that sends a heading (several lines of text) to the active window.

The script I am writing opens a new Notepad++ window and then sends qqhdg space to the new window.

The hotkey's text gets sent ok but it does not execute the hot key ::qqhdg:: which would send the heading lines to the window.

If I type qqhdg followed by a space into the same Notepad++ window, it activates the script and sends several lines of text to the window.

How do I get my AHK script to send the hot key to the new Notepad++ window so it actually activates the hot key?

Send and SendInput both send the text but neither activates the hotkey.

Any help will be greatly appreciated.

My System Specs...
Windows 10 x64 (Latest Updates)
Intel Core i7-920 2.66ghz CPU
12gb DDR3 1600 Triple Chanel Memory
AMD Radeon HD 7850 2GB 256bit GDDR5 Memory Graphics Card
Hisense 49" 4K Monitor (3840x2180)
Last edited by jwinfl on 17 Sep 2018, 06:09, edited 1 time in total.
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: How do I send a text Hotkey to a Notepad++ window

16 Sep 2018, 10:39

Why don’t you send the text of the hotstring directly ?
ciao
toralf
jwinfl
Posts: 89
Joined: 16 Aug 2017, 12:37

Re: How do I send a text Hotkey to a Notepad++ window

17 Sep 2018, 06:09

Toralf,

Unfortunately the hotkey is not just text, the script and text change often, it is long and it is used in several other scripts.

Most importantly there must be an easy way to execute a hotkey (text) from another AHK script.

I could also make it a function, etc. but I would prefer to somehow send text to a window that both Windows and AHK would treat the same as if I typed it into the window myself.

I have several other scripts that require a similar ability to run a AHK text hotkey.

Thank you for your reply.

JWINFL
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: How do I send a text Hotkey to a Notepad++ window

18 Dec 2018, 15:22

Don’t know if you have found a solution by now. It just came to my mind that you could use the hot string also as a label. Hence your hotkey could use GoSub qqhdg to call it.
ciao
toralf
Hatsuko
Posts: 15
Joined: 09 May 2018, 16:56

Re: How do I send a text Hotkey to a Notepad++ window

19 Dec 2018, 14:38

Not sure if this is what you want, but take a look at SendLevel. It has an example that triggers a hotstring via Send.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 255 guests