original path in inkscape script

Post questions on how to use or achieve an effect in Inkscape.
pjensen68321
Posts: 2
Joined: Tue Aug 07, 2012 8:52 pm

original path in inkscape script

Postby pjensen68321 » Tue Aug 07, 2012 8:53 pm

Hi.
I am trying to make a couple of python scripts witch handle cross file
svg linking. but my never ending problem is to find where the original
file actually is located on my computer. the second parameter in
sys.argv is a path to a temporary file. but since inkscape dosen't copy
my whole folders content and subfolders content into my tempoary folder
it can't find the file's to load data from.
I tried to use the sodipodi:docname atribute, but it's not allways the
exact path. then i tried make my own atribute, but it offcourse dosen't
change when i move it to another folder.
any idear on how to get the original path of my svg file and not the
temporary one?

many thanks. Peter.

v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

Re: original path in inkscape script

Postby v1nce » Wed Aug 08, 2012 3:48 am

> find where the original file actually is located on my computer

which file ? your python script or the svg being edited by inkscape ?

> but since inkscape dosen't copy my whole folders content and subfolders content into my tempoary folder

what don't you do it by script then ?

can we see your script ?

pjensen68321
Posts: 2
Joined: Tue Aug 07, 2012 8:52 pm

Re: original path in inkscape script

Postby pjensen68321 » Wed Aug 08, 2012 4:16 am

Its the path for the original svg file. Copying the whole folder strukture is not an option becouse it could be several GB over network.

The scripts basically just look for a use tag and if there is something before # in the xlink:href attribute it takes it as a file to load in, witch is done by using the path of the original file and the file to be loaded.
so actually, i need the location of the temp svg file for data and the location for the original svg file for path to external svgfiles.
If you want I can upload the scipt files but they aren't very complete and is quite a mess right now.

i'm guessing there must be some kind of attribute that i can write in the .inx file (the one that descripe the scripts in inkscape menu)


Return to “Help with using Inkscape”