GIMP Chat http://gimpchat.com/ |
|
Script-fu skip run-mode parameter (solved) http://gimpchat.com/viewtopic.php?f=9&t=20193 |
Page 1 of 1 |
Author: | preklov [ Mon Nov 14, 2022 8:33 am ] |
Post subject: | Script-fu skip run-mode parameter (solved) |
Hi there. I'm new to this forum. I wrote some script-fus and a python-fu, some of which don't need a dialogue and no run-mode parameter either. So i didn't include it in the registration's parameter list. But when I call these functions I am forced to put a RUN-NONINTERACTIVE or RUN-INTERACTIVE at the beginning of the argument list. To keep my code better readable I would be glad to know how to register the scripts without run-mode. Gimp 2.10.32 on macOS Ventura 13.0.1. Thanks in advance. Volker |
Author: | Pocholo [ Mon Nov 14, 2022 4:49 pm ] |
Post subject: | Re: Script-fu skip run-mode parameter |
Can you post the code? It would be easier to see what your referring. |
Author: | Rod [ Tue Nov 15, 2022 3:57 am ] |
Post subject: | Re: Script-fu skip run-mode parameter |
Does the param require an int? Try 1 or 0 |
Author: | preklov [ Tue Nov 15, 2022 4:27 am ] |
Post subject: | Re: Script-fu skip run-mode parameter |
Of course I could substitute the argument with 0 or 1 to shorten the code. But I use to come to work on Gimp macros only in intervals of years, and I fear that next time I try to understand my code I would puzzle about what the heck is that 0 or 1. So I'd prefer a more straightforward solution. My code for two very simple python-fu macros, one to read a metadata value and the other to create a new directory: Code: Select all from gimpfu import * A clipping from a script-fu shows the use: Code: Select all ... |
Author: | ofnuts [ Tue Nov 15, 2022 5:32 am ] |
Post subject: | Re: Script-fu skip run-mode parameter |
The question is why you are making separate script-fu scripts to call your python code when you could have everything in one single python file? Everything in script-fu also exists in python-fu. PS: and IMHO the "readability" is Scheme's main problem, whether Gimp is implied or not. |
Author: | preklov [ Tue Nov 15, 2022 7:58 am ] |
Post subject: | Re: Script-fu skip run-mode parameter |
Many years ago I wrote a few script-fu (Tiny-fu in those days) macros to perform some batch tasks. I improved and extended them 7 years ago. For my needs now I could reuse the most part of them but for the few tasks that are not possible in Scheme (see my code). I agree with you that Scheme is somehow deprecated, not only because of its readability problem (that you can reduce by a consequent indent structure to keep track of the parantheses). Some day I'll go about transferring the whole stuff to Python, I hope. I like to develop new code, but to refight old battles is not so desirable. I don't call for a new feature, I only wanted to know if there is a way to keep Gimp from inserting a parameter that is not defined. If I get told that there is no way then I'll content myself with it. Greetings, Volker |
Author: | preklov [ Wed Nov 16, 2022 1:22 pm ] |
Post subject: | Re: Script-fu skip run-mode parameter (solved) |
I found the solution. For Python-fu there is a register parameter run_mode_param (listed at the very end) that defaults to True. Code: Select all register( Setting it to False did the trick. Thank you for your attention, Volker |
Page 1 of 1 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |