Gimp-Forum.net
script-fu help - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: script-fu help (/Thread-script-fu-help)



script-fu help - egrivel - 03-08-2026

Hi, I have a script-fu script I wrote back in 2003, which I use to save the current image in the ../edited folder, and mark the image as "saved". I have been using this script in every version of Gimp since 2003 without changes, but when I tried to use it in Gimp 3.0 I got the error:

Execution error for 'DoIt':
Error: eval: unbound variable: gimp-image-get-filename

Does anybody know if the function gimp-image-get-filename has changed in Gimp 3.0, or if I'm missing something in my Gimp installation?

Thanks,
Eric


RE: script-fu help - Scallact - 03-08-2026

The procedure browser lists those:

gimp-image-get-file
gimp-image-get-name
gimp-image-get-xcf-file

I don't know which one you're looking for, but the procedure browser give some description (you should use it, it's in the help menu)


RE: script-fu help - egrivel - 03-09-2026

(Yesterday, 11:52 PM)Scallact Wrote: The procedure browser lists those:

gimp-image-get-file
gimp-image-get-name
gimp-image-get-xcf-file

I don't know which one you're looking for, but the procedure browser give some description (you should use it, it's in the help menu)

Thanks for the response. gimp-image-get-file may be a start, but that seems to return the file object. What I need is the full file name, including the path, in order to find the image's _parent_ directory. I need to create a file name that is in a _sibling_ directory of the image.

So how do I get the whole file name? According to the description, the gimp-image-get-name only gets the image's base name (the name inside the directory).


RE: script-fu help - Scallact - 03-09-2026

In python, it's possible with the method .get_path() appended to a Gio.File object. 

Is there a complete doc somewhere, where the GFile format is described?

I have no experience with script-fu, and sadly can't help you further. Hope someone can give better advises.


RE: script-fu help - rich2005 - 03-09-2026

(Yesterday, 07:43 PM)egrivel Wrote: Hi, I have a script-fu script I wrote back in 2003, which I use to save the current image in the ../edited folder, and mark the image as "saved".

Things change and I have just about given up  with both script-fu and python 3

I use possibly a similar script-fu, but using the layer name which is often the same as the file name.

[attachment=14301]

For what it is worth, the attached script (cut-down a bit from the one I currently use) takes the open image and dumps it to the home folder as a jpeg.  There might be enough to get you started converting your old script.