Scripting question - name of input file available

Asked by Steve Ylvisaker on 2010-06-07

We are wanting to write a script that will automatically "checkin" the file,currently open Inkscape, to our content management system. We tried but gave up doing this with version 0.46 because the file name was not available to the scripting language. Has this changed with 0.47. In other words, if I open the file steve-001.svg in inkscape can my script know the name steve-001.svg for its processing? If so - hints on how to do so would be appreciated.


Question information

English Edit question
Inkscape Edit question
No assignee Edit question
Last query:
Last reply:
Launchpad Janitor (janitor) said : #1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

jazzynico (jazzynico) said : #2

Hi Steve,

The file name is stored in the sodipodi:docname attribute of the <svg> element. That's something you could easily access from your python script. You can use inkex (import first!) and:

doc= self.document.getroot()

AFAIK, it already worked in 0.46.


Can you help with this problem?

Provide an answer of your own, or ask Steve Ylvisaker for more information if necessary.

To post a message you must log in.