How to generate the relative path in an import-paint-script?

Klaus Major klaus at major-k.de
Sat Feb 25 04:52:37 CST 2006


Hello Reinhold, old parietal bone!
(= altes Scheitelbein, old private joke :-D

> Hi!
>
> When I import an image I select "Link Only" and "Set Directory" to  
> generate the relative path of it and to reduce memory usage.

after looking at the script of btn "Import" I found that will create  
an abolute path actually!
Looks like the checkbox "Set directory" is not taken into account.

> Now I wrote a button-script to import a picture:
> > import paint from file ImportBild <
> How can I generate the relative path in my script?

"relative" always means "relative to the current folder = the directory"

So if "the directory" is something like:

Win
C:/Folder1/subfolder2/the current project
resp. Mac
/Volumes/harddisk 1/Folder1/subfolder2/the current project

and in this folder you have you folder with your images.
Absolute path:

Win
C:/Folder1/ subfolder2 /the current project/the images
resp. Mac
/Volumes/harddisk 1/Folder1/subfolder2/the current project/the images

You can simply script:
...
import paint from file "the images/name of image.jpg"
...

Or do you mean to set the filename like the "importer" stack does?

In that case:
...
set the filename of img "whatsoever" to "the images/name of image.jpg"
...

That's it :-)

Hope that helps.

> Reinhold

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the metacard mailing list