Open file, run Extension, close inkscape from command line

Discussion about writing code for Inkscape.
abishur
Posts: 5
Joined: Sun Dec 09, 2018 12:52 am

Open file, run Extension, close inkscape from command line

Postby abishur » Thu Dec 13, 2018 10:23 am

I'm still learning about inkscape and what it can do and was wondering if it would be possible to launch inkscape from the command line and specify an extension to run once its open. Specifically, I want to open an SVG and run the extension "Export->Plot". If I could close inkscape after doing so it would be even better. I know this is a really random and specific thing I'm trying to do, but I was curious if Inkscape had this kind of feature built into it by default or if there was a way I could programatically walk through the various steps I'm talking about (and if someone could just point me in the right direction :) )

Thanks!

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Open file, run Extension, close inkscape from command line

Postby Moini » Fri Dec 14, 2018 6:34 am

Yes, that's possible.

See https://inkscape.org/doc/inkscape-man.html, explicitly the example with the verb:

inkscape dateiname.svg --verb=EditDuplicate --verb=FileClose

For the verb, use the 'noprefs' version of the one for the extension.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

abishur
Posts: 5
Joined: Sun Dec 09, 2018 12:52 am

Re: Open file, run Extension, close inkscape from command line

Postby abishur » Sat Dec 22, 2018 5:43 am

That worked like a charm, thanks!


Return to “Programming”