Python quick-scripting extension for Inkscape

I thought I should share my Inkscape plugin.
It's designed for users who are also programmers. It's useful for minor automation. It allows running very short Python script fragments on the fly. It works by calling "exec()" on your line of code, with a variable "n" set to the current node.

It has two components:
  1. an XPATH query, which iterates over a set of objects (or iterate over the current selection)
  2. a short fragment of Python, which you enter, and is executed for each object.
I've given a few examples of how to use XPath to do 'and', 'not', 'intersection' searches. It is quite powerful but not intuitive. If you're not familiar with XPath, you can do all of those things from within the python commands. The XPath requires namespaces on every tag, so you can use the original "svg:" namespace or the abbreviation "s:".

The 5 lines of python are concatenated into a short script. You can actually have more lines if you use "\n" in your scripts and turn on "process escapes in python command". You can toggle each line on and off, to switch individual commands.