Auto start Notepad++ macro

Solution 1:

This may not be the perfect and efficient solution but if you need something complicated it can be of great help.

I can do that if I use any other script besides NPPExec. This can be done via Send command in AutoIt. @Jerph has suggested AutoHotkey which can also be used. So here are the steps:

  1. Download AutoIt
  2. Write a script to send keystrokes through autoit file (SendToNppExec.au3).
  3. Write a NPPExec Script to run SendToNppExec.au3 using AutoIt3_x64 (or whatever windows version you are using).
  4. Enable the script to be executed when NPP starts

Suppose the keyboard shortcut for your macro is Ctrl + F12. Then you can write an autoit script (SendToNppExec.au3) as follows:

Send ( "^{F12}" )

Then use NPPExec to execute the following command at start up: You may include the following in your NPPExec Script which you have to choose to start when Np++ starts.

"C:\...path to...\AutoIt3_x64.exe" "C:\...path to...\SendToNppExec.au3"

I guess you understand the following image to enable NPPExec script on start up.

enter image description here

EDIT You can also convert the au3 script to exe and then call directly from NPPExec script without having to invoke AutoIt3 application.