creating a form



  • Hi I am wondering if it is possible to create a form with locked text.
    I have a template that I use over and over. Currently I have a blank version saved and I have to copy and paste that info to a new note every time I use it in order to add my information to it. I wanted to create a form that locks the text for the blank form in one color and then when you add the information to the form it is in a separate color .
    Does anyone know if this is possible and if so could yo provide me the steps or link on how to do so. Thanks in advance.



  • I’m not exactly a NPP expert, but I’ve never heard of it doing anything with forms, even with a plugin.

    You could do a few alternative things though.

    1. You could add the Python Zen Coding module (I find it to be faster than the Emmet plugin) and learn the key strokes to jump to the next edit point. That doesn’t do any of the locking/coloring you want, but it would make filling in the template easier.

    2. You could make an HTML page with inputs for the things you need to fill out and then have a button to output the completed form to a text box that you can copy.

    3. Do it in Word.

    Sorry, I realize these ideas are a bit of work, but I’m just not sure NPP is the tool you want for this job. Hopefully someone else will chime in with some other ideas but this is all I have for you.

    Good Luck



  • If you know Python or Lua, the PythonScript or LuaScript plugins provide an interface which will allow you to write a script to somehow provide a form, and then they could be made to write their results into the active file in NPP.

    Or you could use one of those plugins, or NppExec to pipe the output of any script, executable, etc (so Perl, HTA, VisualBasic, VBScript, compiled C/C++, …) into the active file in NPP.

    Or you could write a plugin (or pay or cajole someone into writing a plugin for you) that allows you to have a fill-out form to populate the new document.

    But, as @cipher-1024 pointed out, forms are not a native part of NPP.



  • As others have pointed out it isn’t natively supported out of the box.

    That being said it is kind of possible to do what you want with a plugin and/or script. You’d have to write a custom lexer to determine which parts are meant to be locked (depending on the format this may be very easy or complex). Specific Scintilla styles can be “locked”, though supposedly not perfect. The custom lexer could mark and color parts of the form as being locked vs unlocked.


Log in to reply