![]() |
GIMP 3.0.4 Script-Fu Batch Issue: SF-TOGGLE Without Run-Mode - 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: GIMP 3.0.4 Script-Fu Batch Issue: SF-TOGGLE Without Run-Mode (/Thread-GIMP-3-0-4-Script-Fu-Batch-Issue-SF-TOGGLE-Without-Run-Mode) |
GIMP 3.0.4 Script-Fu Batch Issue: SF-TOGGLE Without Run-Mode - AgHornet - 06-27-2025 Hi Hoping someone might be able to help. I've tried so many ways to get this to register and run this simple example in batch mode on gimp 3.0.4 This particular example I am able to register but when its run it fails with a parameter mismatch. If I change SF-TOGGLE to something else like SF-INT it does not register. I've tried add run-mode the param definition, command line and registry but no combination seems to work. My understanding for 3.x.x is that I dont need to add it as it is automatically added. I run this from a windows 11 command line. In the case of attempts that don't register (I open GUI go to Help > Plug in Browser and search for my script) I don't see any errors in the console (Windows > Dockable Dialogs > Error console) relating to registration problems. I have put the script in ..Roaming\GIMP\3.0\plug-ins\test-args Minimal Test Case That Failed #!/usr/bin/env gimp-script-fu-interpreter-3.0 (define (script-fu-test-args arg1 arg2 arg3) (script-fu-use-v3) (gimp-message (string-append "Arg1 (Toggle): " (if arg1 "TRUE" "FALSE") "\n" "Arg2 (String): " arg2 "\n" "Arg3 (String): " arg3 "\n")) ) (script-fu-register "script-fu-test-args" "Test Args" "Test argument passing" "Author" "2024" "" SF-TOGGLE "Toggle Test" TRUE SF-STRING "First String" "" SF-STRING "Second String" "" ) Command Used gimp -i --batch-interpreter=plug-in-script-fu-eval -b "(script-fu-test-args TRUE \"test1\" \"test2\")" -b "(gimp-quit 0)" Error output batch command experienced an execution error: Error: in script, expected type: numeric for argument 2 to script-fu-test-args Stopping at failing batch command [0]: (script-fu-test-args TRUE "test1" "test2") Expected Behaviour Script registers with one toggle and two string parameters Batch mode should accept: Boolean TRUE/FALSE for the toggle. Two string arguments. Should output the three parameter values Observed Behaviour Script registers successfully in GUI Appears in menu Batch mode fails with type mismatch for argument 2 Key Differences from GIMP 2.x 3.x seems to: Handle the toggle parameter differently Require numeric values even for registered strings Have stricter type checking in batch interpreter (Tested on Windows 11, GIMP 3.0.4) |