# [scribus] Bulk Image Path modification / Relative Image Paths

john Culleton john at wexfordpress.com
Wed Aug 17 13:41:50 UTC 2011

On Wed, 17 Aug 2011 07:35:20 +0200
Martin Kempf <baubiologie at gmail.com> wrote:

>
> a.l.e. and John, I tried to change the "geeky way" with notepad++
> (handling big files), but inside the .sla opened as text file I
> didn't find any path in clear... did I something wrong?
>
> So I re-changed the path on the HD as before and created the
> "éléments pour la sortie", but I never manipulated those files, can I
> use them afterward to reopen the project and modify it like before?
>
> John, I just try more logical structure in my new organization of my
> paths :-)
>
> Martin Kempf
>
>
>
>
>
> Le 15/08/2011 17:39, john Culleton a écrit :
> > On Mon, 15 Aug 2011 16:49:37 +0200
> > Martin Kempf<baubiologie at gmail.com>  wrote:
> >
> >> Hello,
> >>
> >> I just cleaned up my HD, and changed the absolute paths of my
> >> scribus files and image folders on my main working HD.
> >> Now, of course, I have to change image per image the path inside my
> >> nearly hundred scribus files...
> >> I'm using 1.3.3.14 portable on Win7
> >>
> >> Is there any way to bulk change all paths inside a scribus
> >> document? Or if I could just click inside of the path-text in the
> >> image manager and copie-past the new path...
> >>
> >> And, which would make the future file manipulations much easier, is
> >> there any way to put the image path in a relative way? for example
> >> all images in a sub-folder, pointed like "../Images/" or somehow,
> >> and I could find my images once the whole  docs folder structure
> >> placed elsewhere...
> >>
> >> Thanks for your help,
> >> Martin
> >>
> > On my Linux system I have a subfolder:
> >
> > /usr/local/active
> >
> > And each project has its own folder within active:
> >
> > /usr/local/active/grammar
> >
> > for a typesetting and indexing project for an academic with the last
> > name of Grammar (sic).
> >
> > Within each project folder are all the pertinent files, including
> > graphics, source and pdf. If things get too crowded I may have yet
> > another subfolder for the graphics, e.g.:
> >
> > /usr/local/active/grammar/illos
> >
> >
> >
> > I recognize that fiddling with folder structures is more automatic
> > to Linux users than it is to Windows users. But the same mechanisms
> > exist.
> >
> > As for bulk changes within a Scribus .sla file this also is easy for
> > me. I am used to editing plain text documents in Gvim. Again this
> > may not be as common in the Windows world. Gvim has a change
> > statement like:
> >
> > :% s/\\myfolder\\foo/\\myfolder\\foo\\bar/g
> >
> > this string translates into
> >
> > : do a command
> > % apply it to all lines
> > s substitute
> > / / / the from-to string dividers
> > \\myfolder = \myfolder
> > \\foo = \foo
> > \\bar = \bar
> > g apply it to all instances in a line (i.e. globally)
> >
> > The g is necessary because Scribus sla files tend to run many
> > statements together without intervening end-of-line characters. Now
> > the above command looks very complicated to the first time user but
> > to the experienced Gvim user it is automatic. I have used similar
> > substitution strings literally thousands of times in the past two
> >
> > Another popular text editor is Emacs.
> >
> > The default text editor Notepad that comes with Windows is very
> > limited and tends to blow up on big files etc. So I suggest to all
> > users that they learn a more capable editor. Vim/Gvim is free as is
> > Emacs.
> >
> > John Culleton
> >
> > ___
> > Scribus Mailing List: scribus at lists.scribus.net
> > Edit your options or unsubscribe:
> > http://lists.scribus.net/mailman/listinfo/scribus
> > http://wiki.scribus.net
> > http://forums.scribus.net
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://lists.scribus.net/pipermail/scribus/attachments/20110817/8697a7fc/attachment.html>
> ___ Scribus Mailing List: scribus at lists.scribus.net
> Edit your options or unsubscribe:
> http://lists.scribus.net/mailman/listinfo/scribus
> http://wiki.scribus.net
> http://forums.scribus.net

really an inferior product. For windows users Vim three icons will
appear: Gvim, the full product, Evim, a simplified user interface for
newcomers, and Rvim, a read-only version. I always delete the last one.

Using the full product, Gvim, you can add extra endlines to an .sla file
yet still have a functional file. For example, to append a newline
after each string consisting of "(space) I used the command:

<esc>:% s/" /" \r/g

The escape puts one in command line mode,
the :  is a command prefix,
the %  means apply this command to all lines,
the s  means substitute,
the    / / / enclose the before and after strings,
the "  followed by a space is the original string,
the " \r  is the new string (with end of line attached)
and the g  means change all occurrences in a line, not just the first
one.

The new .sla file is executable by scribus (I just checked) but the .sla
file is much more readable, and changeable.

If in your .sla file the addresses are relative rather than absolute
then my earlier suggestion of putting all the bits and pieces of the
document in one dedicated directory applies. The collect command will
pull all those bits and pieces together for transport, as someone (ALE?)
suggested previously.