I have a svg file that contains many text objects filled with the color 0070c0. It contains also other objects.
I would like, via CLI, to select only those text objects with that fill, and then vertically align them all to bottom of the page.
I have tried to select those using this command, but I cannot select using the fill=#0070c0 parameter
inkscape --actions="select-by-selector:text;select-invert;delete;export-plain-svg;export-filename:out.svg;export-do" input.svg
Currently, in Inkscape,
select-by-selectorhas some limitations (see this for details). however, you can uselxmlmodule in Python or any other tool to get the IDs of the text elements with a specific fill color. Then we can use Inkscape actions to align the text elements.get_ids.pyextracts the IDs of text elements with a specific fill color:get_ids.py:Make sure you have lxml installed with:
In Unix-like shells such as bash:
On Windows using Powershell (I haven't tested it but it should work):
Result:
Before:
After: