Gimp-Forum.net
GIMP 3 script-fu not loading and run with error when Loaded through Console - 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)
+---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions)
+---- Thread: GIMP 3 script-fu not loading and run with error when Loaded through Console (/Thread-GIMP-3-script-fu-not-loading-and-run-with-error-when-Loaded-through-Console)



GIMP 3 script-fu not loading and run with error when Loaded through Console - markhahn2000 - 12-04-2025

new to v3 and having scripting issues.

My test case is a published "hello World"script. (https://testing.developer.gimp.org/resource/writing-a-plug-in/tutorial-script-fu/)

On MacOS I have given GIMP full access in system settings. I have placed this .scm in a subdirectory with the same name as the executable .scm file. In Folders, this script directory is the first listed.

It does not show up when I restart GIMP.

I've read that I can load it in the Console, and when I do this, I get the error:

     "Error: eval: unbound variable: (/Users/mark/GIMP_scriptfu/mh_hello_world3/mh_hello_world.scm : 35)  [] "

On line 35 in the script, it holds the copyright year. How is this causing this script to error out?

I have tried different example scripts and am getting similar errors.

I am new to this. Thanks for any help!

Code:
#!/usr/bin/env gimp-script-fu-interpreter-3.0

(define (script-fu-zemarmot-hello-world
        image
        drawables
        font
        compute-size
        size
        text)
 (script-fu-use-v3)
 (let* ((layer (gimp-text-layer-new image text font size UNIT-PIXEL)))

   (gimp-image-undo-group-start image)

   (gimp-image-insert-layer image layer -1 0)
   (if (= compute-size TRUE)
     (let* ((image-width (gimp-image-get-width image))
            (layer-width (gimp-drawable-get-width layer)))
       (begin
         (set! size (* size (/ image-width layer-width)))
         (gimp-text-layer-set-font-size layer size UNIT-PIXEL)
       )
     )
   )

   (gimp-image-undo-group-end image)
 )
)

(script-fu-register-filter "script-fu-zemarmot-hello-world"
 "Script-Fu v3 Hello World"
 "Official Hello World Tutorial in Script-Fu v3"
 "Jehan"
 "Jehan, Zemarmot project"
 "2025"
 "*"
 SF-ONE-OR-MORE-DRAWABLE
 SF-FONT       "Font"               "Sans-serif"
 SF-TOGGLE     "Compute Ideal Size" #f
 SF-ADJUSTMENT "Font size (pixels)" '(20 1 1000 1 10 0 1)
 SF-STRING     "Text"               "Hello World!"
)

(script-fu-menu-register "script-fu-zemarmot-hello-world" "<Image>/Hello W_orlds")



RE: GIMP 3 script-fu not loading and run with error when Loaded through Console - Ofnuts - 12-05-2025

Is your directory and addition to scripts or to plug-ins? Given the code it should be in plug-ins I think.