Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am doing something like this in my F5 command (execute):

C:\Python27\pythonw.exe G:\

I want to run this script everytime I save the file. When I save this command as Ctrl + S, Notepad++ does not run it, only saves my file.

share|improve this question
So, instead of pressing [Ctrl]+[S], then [F5] and [Enter], you just want to press [Ctrl]+[S] to save and run? – iglvzx Feb 16 '12 at 20:24
Yes. (characters_needed_to_send) – SuitUp Feb 16 '12 at 20:33

You can save a macro that will do this.

First, change the file so you can save. Then Start Macro, Ctrl+S, Execute your script, Stop Recording, Save recorded Macro.

Now you can either save this macro as Ctrl+S plus something, or just Ctrl+S, the latter would require you to un-map Ctrl+S.

If you must have it as a global hook into Ctrl+S (as Save) I do not have an answer for you, as I do not believe this is allowed, though you can macro any combination of events you want.

Hope this helps!

share|improve this answer
Oh, I need to have 15 reputation to vote up you. :( – SuitUp Feb 16 '12 at 20:31
It does not work, how should i execute script so it will be recorded? – SuitUp Feb 16 '12 at 20:40
I believe you can give it a shortcut and then run that shortcut, in this case I was using a Python Script Plugin found here: – jidar Feb 16 '12 at 20:52

You can use AutoHotkey to easily create macros. For your case, the following script will work:

#IfWinActive, ahk_class Notepad++
^s:: ;Ctrl+S
    Send, ^s{F5}
    WinWaitActive, Run...
    Send, {Enter}

You may need to run the script as an administrator, since Notepad++ uses its own keyboard hooks.

Download:, 784KB

share|improve this answer
Note that the recommended site to download AutoHotKey from is so the donwload from seems to be from iglvzx's own domain which doesn't currently resolve (so the download doesn't even work). AutoHotkey is an excellent option to have a solution with, but rather than share a script, iglvzx seems to have preferred providing a custom installer. – TOOGAM Nov 19 '15 at 18:27

If you use the NppExec plugin, the following macro will do what you want:

C:\Python27\pythonw.exe G:\

This can be bound to any key combination, does not rely on any existing shortcuts, and will bring up a save dialog if necessary.

share|improve this answer
took some fiddling on my part, but indeed, this is a good solution. – automatonic Aug 20 '12 at 23:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.