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.
If "Skip over errors" is selected, then it will execute your code on each node, committing only those nodes which didn't give an error. If it is not selected, then the script stops, displays the error, and does not commit any changes.
If "Process escapes in python" is on, then each line can store multi-line commands, if you use "\n" and/or "\t".
Parse path coordinates will examine the "d" attribute of any path, and call "parsePath". The result is stored in "p", and is an array of path nodes. Each node is ['c', (x,y)], representing the command letter, and absolute coordinates. You can edit "p".
You have access to all functions in
* "math" (sin, cos, tan, atan, rand, floor etc.)
* "inkex" (etree, addNS, unittouu, uniqueId, createGuide, getNamedView etc)
* "simplepath" (translatePath, scalePath, rotatePath),
* "simpletransform" (computeBBox)
* "simplestyle" (svgcolors dictionary, parseColor, formatColoria, formatColor3i, formatColorfa, formatColor3f, isColor),
* "pturtle", and "bezmisc".
* Additionally, 'self' is defined (with properties such as 'selected', 'current_layer', 'view_center', 'document', 'original_document').
* You can also use "print" commands for debugging, since stdout is mapped to the error dialog that pops up after the script completes.
Some examples of these commands are given under "Commands".
So, it's basically quite a lot more powerful than the built-in find/replace tool. And quicker than writing your own extension.
There is brief documentation in the dialog box.
Download existing version from http://www.smanohar.com/inkscape.php (Sanjay Manohar 2014)
The wiki uses Markdown syntax.