Community
    • Login

    File creation automation

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    filesmacro
    3 Posts 2 Posters 1.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Mikhail VM
      Mikhail V
      last edited by

      Hello all,

      I want to make specific automation in NP++.
      Here is approximately the result I want to achieve.
      Imagine such workflow:

      1. I edit a file normally (python code).
      2. I save the file normally
      3. 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

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Mikhail V
        last edited by

        @Mikhail-V

        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

        Mikhail VM 1 Reply Last reply Reply Quote 2
        • Mikhail VM
          Mikhail V @Claudia Frank
          last edited by

          @Claudia-Frank

          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.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors