Interfacing to an external program.

General discussions about Inkscape.
scruffydog
Posts: 13
Joined: Thu Nov 15, 2012 12:14 pm

Interfacing to an external program.

Postby scruffydog » Mon Jan 05, 2015 5:24 am

Hello,

I am interested in interfacing Inkscape to an external program. Is there a way to get Inkscape to save an SVG file (e.g. drawing.svg) every time a modification is made to a drawing? I would also like Inkscape to be triggered by the external program to reload drawing.svg once the external program is done making changes to it. How could I do this? Furthermore, If this question would be better treated by the programming section of the forum, is there a way I can move it?

Craig

Janne
Posts: 228
Joined: Wed Oct 29, 2014 4:15 am

Re: Interfacing to an external program.

Postby Janne » Mon Jan 05, 2015 6:41 am

You can set Inkscape to auto save every x ( your defined intervals ) minutes in File/Inkscape Preferences.

scruffydog
Posts: 13
Joined: Thu Nov 15, 2012 12:14 pm

Re: Interfacing to an external program.

Postby scruffydog » Mon Jan 05, 2015 9:42 am

Thank you for you quick and thoughtful response. I checked out the auto save feature too. However I would like to save at smaller intervals OR instantaneously whenever something is changed in the UI. This would be nice, but not required I think now. However, in the opposite direction I would like a Java program to trigger Inkscape revert functionality to have Inkscape go back to an old copy of a document saved as a file. This would happen when the Java program gets done with some transformations of SVG information, creating a new document. So really Inkscape is not reverting in the strict sense of the term, but retrieving a new version of the file (and the replacing the old document). The language is somewhat confusing for that reason. The Inkscape GUI should stay open during this process.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Interfacing to an external program.

Postby ragstian » Mon Jan 05, 2015 10:32 am

Hi.

If you need to save at short interval you can use an external program
to send key-presses directly to inkscape, I have used the pyton module
"sendkeys" to do something similar.
I am sure you will find a java module to do the same if that's your cup of - java!

A few pointers (pun intended);
http://win32com.goermezer.de/content/view/136/284/
http://kvance.livejournal.com/985732.html
https://www.youtube.com/watch?v=Q7EexF59KHg

Good Luck.
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar


Return to “General Discussions”