Automatically import new SVGs to Inkscape

Asked by Alberto Giachino on 2018-03-08

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

English Edit question
Inkscape Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
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.