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.
07-02-2025, 12:21 AM (This post was last modified: 07-02-2025, 12:22 AM by Ofnuts.)
(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...
07-02-2025, 07:55 AM (This post was last modified: 07-02-2025, 07:55 AM by rich2005.)
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.
07-02-2025, 12:34 PM (This post was last modified: 07-02-2025, 12:50 PM by Frenchie.)
(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.
Quote:..."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.
07-02-2025, 03:02 PM (This post was last modified: 07-02-2025, 05:15 PM by Ofnuts.)
(07-02-2025, 12:34 PM)Frenchie Wrote: IYou 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.
Depends on where the change it, as I said.
In the script-fu server, scripts files are read once for all when the server starts, or when you asked it to refresh the scripts.
In a plugin, the code file is read:
On Gimp startup (if new or more recent than on previous startup) to create the registration entry in pluginrc , set-up menus, add to PDB with prrper arguments, etc...
On each execution
So if the file is new (or in a a new location), and you change the registration part (menu entry, arguments, etc...) then yes you have to restart Gimp to have it taken in account, because this updates the pluginrc file. But other changes in the code (i.e., those you do when you debug) are automatically taken in account when you execute. Of course at the beginning coming up with proper registration code may require several tries, and so several Gimp startups. But once this is done debugging/enhancing the code is smooth sailing.
Quote:..."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.
I ran the test with the same file as you (quick-save-webp.scm) saved in the Gimp scripts directory:
- Open a Gimp 3.0 session
- Open an image file
- Run quick-save-webp from the Tools menu
- Edit the quick-save-webp.scm file with NotePad
- Save the file
- Run quick-save-webp from the Tools menu
The last update in quick-save-webp.scm file was not taken into account (it only happens if I close Gimp).
One clarification: I'm using a Windows 10 PC.
07-02-2025, 07:56 PM (This post was last modified: 07-02-2025, 07:57 PM by Ofnuts.)
(07-02-2025, 06:39 PM)Frenchie Wrote:
(07-02-2025, 01:53 PM)rich2005 Wrote:
Quote:..."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.
I ran the test with the same file as you (quick-save-webp.scm) saved in the Gimp scripts directory:
- Open a Gimp 3.0 session
- Open an image file
- Run quick-save-webp from the Tools menu
- Edit the quick-save-webp.scm file with NotePad
- Save the file
- Run quick-save-webp from the Tools menu
The last update in quick-save-webp.scm file was not taken into account (it only happens if I close Gimp).
One clarification: I'm using a Windows 10 PC.
If it's in the scripts directory then it is a script. To work as a plugin it should be in the plug-ins directory.