Sorry for any errors, english is not my native language
I'm in need of a certain script to manipulate a bunch of images, to not bother people to death by asking "can someone do this for me?", i'm trying to learn how to write them myself.
I start by creating a script that will move images from one folder to another, from /Images/origin to /Images/destination, I need this to be a relative path since i need it to work anywhere as long as theres a origin and destination folder inside a Images folder.
Currently I have the next script (taken from what i could learn, copy and understand) but when saving an image it doesn't save where i expect it to go, actualy it does nothing.
(define (batch-move)
(let* (filelist (cadr (file-glob "/Image/origin/*.png" 1))))
(while (not (null? filelist))
(let* ((filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIOVE filename filename)))
(draw (car (gimp-image-get-active-layer image)))
(gimp-file-save RUN-NONINTERACTIVE image draw filename/../destination filename)
(set! filelist (cdr filelist))
))))
The place where is the function(?) gimp-file-save, i've tried to put the path before, and in this example after, but it doesn't work.
This is assuming the filename is the complete path using /../ to go back a folder and /destination/ go to the next, same way as to navigate windows using relative path directories
I also understand that the gimp-image-get-active-layer is probably not necessary but this is for me to later add all the functions that i need.
And my question is why is it not working?, from what I gather the filename variable is the entire path, but if it isn't then what is is?