Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Missing script-fu "refresh scripts" submenu
#4
(07-02-2025, 12:21 AM)Ofnuts Wrote:
(07-01-2025, 07:20 PM)Frenchie Wrote: Hello,
Sorry for my bad English (translated by Google Translate),
I just downloaded version 3.0.4 of Gimp. Previously, I was using version 2.10.38.
I created several scripts that worked fine with version 2.10. Following the changes made in version 3.0, some functions have disappeared (for example, gimp-image-set-active-layer was replaced by gimp-image-set-selected-layers) or their parameters are different (for example, gimp-edit-copy has a new parameter "vector").
Updates are tedious (edit the script - test - edit again... until the script works correctly).
In version 2.10, it was possible to edit the script file (.scm) and have the update taken into account in Gimp via the "refresh scripts" submenu. However, this submenu is missing in version 3.0. You must therefore close Gimp and reopen it each time you make a change.
Do you know if there is a way to either make the "refresh scripts" submenu appear or to take script changes into account without closing Gimp?
Thank you in advance for your answers.

The solution is to make your SCM code run as a a plain plugin (yes, this is doable in v3). Then you don't even need to refresh your script, it's implicit because your coded is reloaded from disk when invoked. As with Python I assume this is fine as long as you don't change the registration part, since that part is only checked and taken in account when Gimp restarts.
 
I don't know how much changes this requires in the registration code nor exactly how it is done for script-fu, but now that you know what to look for...
Thank you for your reply.
If I understand correctly, you're suggesting I turn all the scripts (I have about thirty) into plugins. This would save me from having to update my scripts every time I try to fine-tune them.
I'm not familiar with this, and I haven't found any relevant tutorials.
In any case, I'll have to adapt the scripts to be compatible with Gimp 3.0, which I've started to do and which represents the bulk of the work.
A list of the 2.x functions modified or replaced in V3.0, and the equivalent function in V3.0, would have been welcome.

(07-02-2025, 07:55 AM)rich2005 Wrote: I miss the 2.10 ability to move a script into the scripts folder and refresh without having to restart Gimp as well.  My views on script-fu are well known - hate it but I still can not get my head around Gimp 3 python which just looks a jumble to me.

For a simple procedure, you can run a scm as a plugin (in its own folder) starting with a shebang #!/usr/bin/env gimp-script-fu-interpreter-3.0  The same (simple) without the shebang also works in the scripts folder. I use the attached quick-save-webp.scm to export and mark image as clean. All it does is dump a webp in home (linux) or User\your_id (win).

There are several script-fu's around as better examples. The other one in the attachment rename-layers.scm from Mark Sweeney is heavily commented and worth a look.
Thank you for your reply.
You write:
"For a simple procedure, you can run a scm as a plugin (in its own folder) starting with a shebang #!/usr/bin/env gimp-script-fu-interpreter-3.0"
Do you mean that in this case, there's no need to close Gimp and reopen it each time I make a change?
I ran a test: the change isn't taken into account if you don't close Gimp.
Reply


Messages In This Thread
RE: Missing script-fu "refresh scripts" submenu - by Frenchie - 07-02-2025, 12:34 PM

Forum Jump: