We help IT Professionals succeed at work.

Run AutoHotkey script directly from Notepad++

Hello,

Is there a way to run an AutoHotkey (AHK) script directly from Notepad++?

I recently began editing my AutoHotkey scripts in Notepad++ rather than in Notepad. Now I'm wondering if, after making changes to a file, I can run it directly from Notepad++.

With regular Notepad, you must first save the edited file then go to Explorer (or wherever you have a shortcut) and run the file from there. It would save several keystrokes if the file could be run directly from Notepad++.

I do see a "Run" menu but after clicking, a box comes up asking you to enter the file you'd like to run. It would be quicker of course if there's a way to simply run the code in the currently active tab.

Thanks
Comment
Watch Question

Joe WinogradDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2018

Commented:
Hi Steve,
Ironically, I'm participating in an AutoHotkey webinar right now, but will give you my thoughts when the webinar is over, which should be in two hours. Regards, Joe
Notepad++ if extremely versatile... with the right plugins.

nppexec from SourceForge.net is probably the one you will want.  You can read more about it here:  https://sourceforge.net/p/npp-plugins/discussion/672146/thread/db04bd47/

Hopefully, when Joe returns to this question he will have more info for you.  I don't personally use this plugin since I use dedicated IDE's for the coding I do in various languages.  I find the IDS's are richer and serve me better.

Good luck.
Developer
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2018
Commented:
Hi Steve,
You and I have discussed the value of pictures and videos before, so I decided to take a video approach to this one — see the attached MP4. As a complement to the video, here's what you want in NPP's The Program to Run box:

"c:\Program Files\AutoHotkey\AutoHotkey.exe" "$(FULL_CURRENT_PATH)"

Of course, it's possible that the path to AutoHotkey.exe could be different, depending on where you installed it. Regards, Joe

P.S. The video says to end the parameter with close quotes — should have also said a right parenthesis, as shown above.

Update: I decided this was worthy a full video, so I published this 5-minute EE Micro Tutorial:
https://www.experts-exchange.com/videos/6318/
You may safely ignore my original video attached to this post and view just the Micro Tutorial, which is more thorough. Regards, Joe
steve-run-ahk-in-npp.mp4

Author

Commented:
Thanks for the responses.  Great video Joe.
Joe WinogradDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2018

Commented:
You're welcome, Steve, and thanks to you for the compliment — I appreciate it!