How to use notepad++ to make a .cfg file4/17/2023 (Tested with Notepad 6.4.3 (Unicode) and Python Script 0.9.2.0. LOG file starts the program in the first place, and should look like this: from Log import updateLog callback ( clearBufferIDList, ) # Tried FILEOPENED before, but had problems with it (wrong buffer getting updated, not updated at all or delayed.). remove ( args ) except ValueError : pass notepad. scrollCaret () def clearBufferIDList ( args ): try : BufferIDList. add ( bid ) # Move to the end of the document and append timestamp etc. getCurrentBufferID () if bid not in BufferIDList : BufferIDList. BufferIDList = set () def updateLog ( args ): editor. Obviously, you can adjust the keyword and timestamp format to your own liking.įrom Npp import * import datetime # To prevent that the same file gets be modified again while open, we'll keep an eye on all open. Handles files that are opened when the text editor is already running. Click on the Plugins option in the top menu and select Plugins Admin from the context menu. Also, you can search for Notepad through the Windows search bar. That file contains the actual timestamp code and the notification callbacks, so that the script Doble clicks the Notepad shortcut on your desktop to enter its main interface. %APPDATA%\Notepad \plugins\config\PythonScript\scripts, depending on your setup of Notepad .Īlso, change the NPPPythonScript initialisation mode (Notepad -> Plugins -> Python Script -> Configuration -> Initialisation) from LAZY to ATSTARTUP. Put them both either into %ProgramFiles(x86)%\Notepad \plugins\PythonScript\scripts or With help of the plug-in PythonScript for Notepad .įirst, create two script files: Log.py and startup.py. Since my editor of choice nowadays is Notepad and I couldn’t findĪ similar solution for it (maybe I haven’t looked hard enough), I wrote one myself in the Python scripting language, LOG as its first characters and a timestamp will be appended on subsequent openings. The original Notepad of Microsoft Windows has a nice feature to create log files:
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |