File creation automation
-
Hello all,
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.PS:
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,
Mikhail
-
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.
Cheers
Claudia -
Thank you!
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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login