File creation automation
I want to make specific automation in NP++.
Here is approximately the result I want to achieve.
Imagine such workflow:
- I edit a file normally (python code).
- I save the file normally
- After that I want automatically create a copy of this file with
some other filename (e.g. with some suffix added)
The contents of the copy must be created from current contents using
some char replacements.
For example: the copy should contain the same py code, but with all
hyphen characters replaced with underscore characters.
So it’s basic replacement.
The auto-created file should not be opened in NP, so it just goes in a folder silently.
Just if you ask why I need it: I need this because I want to use hyphen char
inside tokens, which Python not allows.
So i edit my .py file, i use “minus” char instead of hyphen for minus operation
and I use hyphen inside tokens to make the code more readable.
In the end those two chars must be auto-replaced to create runnable python code,
i.e. hyphen becomes underscore, and minus becomes hyphen again.
Can I make the whole automation in NP++?
Possibly so that the whole is made with one keystroke.
If yes, what should I start with?
Note : I have started with NP++ not so long ago and don’t know how to
make automations in NP++.
Thanks in advance,
as you are programming in python it might be best if you use the python script plugin for
your automation. This plugins provides all editor (scintilla) and notpead++ functions you need.
The documentation is quite good but if you need help to get started let us know.
It is very, very good news indeed.
I have installed the plugin and tested few simple things - it works!
I am so happy - the only bad thing that I did not start with NPP some years earlier.