4 Oct
2007
4 Oct
'07
5:05 a.m.
On Wed, 2007-10-03 at 21:40 -0700, Redefined Horizons wrote:
I was wondering how to obtain the current selection from within an Inkscape script written in Python. I note that the getselected method in the inkex.py file contains a comment that says it "Collect selected nodes". Does this mean that it only returns the nodes from the selection? Does it return the DOM representation of the selection?
What happens in that the script is given the XML document and a list of id's for the selections. So it would look something like this if it was called on the commandline:
python myscript.py --id=node243 old_doc.svg > new_doc.svg
The inkex.py wrapper turns all of this into my "python like" objects providing DOM and lists of the selected nodes.
--Ted