Automatically import new SVGs to Inkscape

Asked by Alberto Giachino on 2018-03-08

https://stackoverflow.com/questions/49170684/automatically-import-new-svgs-to-inkscape

I want to write an extension or find some way to automatically import to an Inkscape document the new files that appear in a given folder. I don't want to simply update the SVG/XML document because Inkscape has to be open for another extension (AxiDraw) to work.

My problem is that I cannot find a way to make my extension work "in the background", either it goes into an infinite loop that crashes the program or, if I use for example the Timer from threading it just stops after the first execution.

Also using the command line doesn't seems to work since there is not an import command and verbs don't work in shell mode.

Is there some relatively easy way to work around these problems without having to dig into the c++ source code?

Question information

Language:
English Edit question
Status:
Solved
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Solved by:
Hachmann
Solved:
2018-03-11
Last query:
2018-03-11
Last reply:
2018-03-10
Best Hachmann (marenhachmann) said : #1

Python extensions currently work by 'halting' the Inkscape main process. Then they modify the document, which is then loaded back into Inkscape.

So this cannot work. You'd need to run it manually in regular intervals, or set up some 'click bot' that does that for you.

Alberto Giachino (ag89) said : #2

Yes, I thought so, I wanted to be sure. Thanks.

Alberto Giachino (ag89) said : #3

Thanks Hachmann, that solved my question.