home download documentation forums source code project change log charity donations Latest Version: 1.0.8.0 License: GPL3
|
Python Script for Notepad++The scripting plugin
Here's a sample... # Simple search / replace editor.replace("old", "new") # Regular expressions search and replace editor.rereplace(r"^([A-Z]{3,5})--\1", r"CODE: \1") # Call a Scintilla function editor.appendText("Changed codes\r\n"); # Save the file newFilename = notepad.getCurrentFilename() + ".changed" notepad.saveAs(newFilename); # Write to the console window console.write("Saved as %s\n" % newFilename) # Create a new document notepad.new() # Run a command on the file, and output results to the new file console.run('compiler.exe "%s"' % newFilename, editor) So, why another scripting plugin...
Python's a great choice for a scripting language - it's very easy to learn, very easy to read and write, and can be object oriented (in fact, it has an excellent model), but doesn't need to be. A script that looks like notepad.open("c:\autoexec.bat")is just as valid as a full blown object oriented magic system that turns Notepad++ into a coffee-making spreadsheet application. DonationsSo, I do this for fun - Notepad++ is a great editor, but I missed not being able to script things properly, so I put this together. I'm not after donations towards my coffee, but, my sister's a doctor, and is trying to build a hospital in Ghana. She's already raised enough to send a load of equipment over to an existing hospital, which makes a terrific difference in a place where equipment is scarce. She needs 100,000GBP to build the hospital and fill it with decent equipment. It sounds like a lot, but it isn't really. If one in fifty of the people that downloaded my last plugin (Plugin Manager) gave 1 pound each, that would be enough. It's not compulsory by any means (and specifically, for UK tax reasons, is not by way of payment for goods, you get the plugins for free), but, it would bring some meaning to the months of work I put into this, and you know that you've made a difference - and it's got to be a better cause than handing over hard earned cash to profit some software firm. Visit the charity, or go straight to the online donation page (whatever amount you can, every penny counts). |