RSS/Atom feed Twitter
Site is read-only, email is disabled

Save all opened files with ONE click, or with script...

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

12 of 13 messages available
Toggle history

Please log in to manage your subscriptions.

Save all opened files with ONE click, or with script... durumdara@gmail.com 22 Nov 10:25
  Save all opened files with ONE click, or with script... Choi, Ji-Hui 22 Nov 10:41
   Save all opened files with ONE click, or with script... durumdara@gmail.com 22 Nov 11:50
    Save all opened files with ONE click, or with script... David Hodson 22 Nov 13:42
  Save all opened files with ONE click, or with script... Joao S. O. Bueno 22 Nov 11:15
  Save all opened files with ONE click, or with script... saulgoode@flashingtwelve.brickfilms.com 22 Nov 11:51
   Save all opened files with ONE click, or with script... durumdara@gmail.com 22 Nov 12:13
    Save all opened files with ONE click, or with script... durumdara@gmail.com 22 Nov 16:29
   Save all opened files with ONE click, or with script... buralex@gmail.com 23 Nov 04:08
    Save all opened files with ONE click, or with script... Sven Neumann 23 Nov 08:57
     Save all opened files with ONE click, or with script... saulgoode@flashingtwelve.brickfilms.com 24 Nov 07:10
1195929800.14221.19.camel@b... 07 Oct 20:18
  Save all opened files with ONE click, or with script... saulgoode@flashingtwelve.brickfilms.com 24 Nov 23:20
durumdara@gmail.com
2007-11-22 10:25:50 UTC (about 17 years ago)

Save all opened files with ONE click, or with script...

Hi!

I make many photos.
The postprocessing of photos are very tireable, because I can open only 15-25 pictures only (because if I open more, the GIMP slowing down), I need to use some Colour changes (Automatic, I use shortcuts Alt + 0..9 for it). This time I cannot automatize the process, because I must see, what's happening after use of the auto "tricks".

And next I need to close every opened files one by one with clicking on [X], and Save, and Save with defaults. This section is very hateable, slow, and automatizable (I think).

But I don't know, how to do it!

Can anyone help me in this problem?

I used gimp 2.4, on windows XP. I have Python 2.4 on my machine.

Thanks for your help: dd

Choi, Ji-Hui
2007-11-22 10:41:32 UTC (about 17 years ago)

Save all opened files with ONE click, or with script...

hi.
this plugin may be helpful for you.
http://members.ozemail.com.au/%7Ehodsond/dbp.html

Joao S. O. Bueno
2007-11-22 11:15:53 UTC (about 17 years ago)

Save all opened files with ONE click, or with script...

On Thursday 22 November 2007 09:25:50 am durumdara@gmail.com wrote:

Hi!

I make many photos.
The postprocessing of photos are very tireable, because I can open only 15-25 pictures only (because if I open more, the GIMP slowing down), I need to use some Colour changes (Automatic, I use shortcuts Alt + 0..9 for it). This time I cannot automatize the process, because I must see, what's happening after use of the auto "tricks".

And next I need to close every opened files one by one with clicking on [X], and Save, and Save with defaults. This section is very hateable, slow, and automatizable (I think).

But I don't know, how to do it!

Can anyone help me in this problem?

Try using "file->close all" from the toolbox.

I used gimp 2.4, on windows XP.
I have Python 2.4 on my machine.

Thanks for your help: dd

durumdara@gmail.com
2007-11-22 11:50:20 UTC (about 17 years ago)

Save all opened files with ONE click, or with script...

Choi, Ji-Hui wrote:

hi.
this plugin may be helpful for you.
http://members.ozemail.com.au/%7Ehodsond/dbp.html

I don't see any Windows downloads. Is it Linux platform dependent?

dd

saulgoode@flashingtwelve.brickfilms.com
2007-11-22 11:51:48 UTC (about 17 years ago)

Save all opened files with ONE click, or with script...

And next I need to close every opened files one by one with clicking on [X], and Save, and Save with defaults. This section is very hateable, slow, and automatizable (I think).

But I don't know, how to do it!

It is, to my knowledge, impossible for a script or plug-in to close an image which it did not open. I believe this is to ensure that multiple processes running simultaneously do not interfere with each other (for example, a script or plug-in closing an image while another script is still working on it).

I was able, however, to write the following short Script-fu which will save all of your open images. This will allow you to save and close all of your images by performing a "File->Save ALL" followed by a "File->Close all".

Save the following lines to "C:\Documents and Settings\durumdara\.gimp-2.4\scripts\saveall.scm"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ;
; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details.

(define (script-fu-save-all-images) (let* ((i (car (gimp-image-list))) (image))
(while (> i 0)
(set! image (vector-ref (cadr (gimp-image-list)) (- i 1))) (gimp-file-save RUN-NONINTERACTIVE image
(car (gimp-image-get-active-layer image)) (car (gimp-image-get-filename image)) (car (gimp-image-get-filename image))) (gimp-image-clean-all image)
(set! i (- i 1)))))

(script-fu-register "script-fu-save-all-images" "/File/Save ALL"
"Save all opened images"
"Saul Goode"
"Saul Goode"
"11/21/2006"
""
)

durumdara@gmail.com
2007-11-22 12:13:16 UTC (about 17 years ago)

Save all opened files with ONE click, or with script...

Hi!

Fu said:
Unbound variable...
In this time the MenuPoint not visible. Possible this caused by translated version of Gimp???

Thanks for your help: dd

David Hodson
2007-11-22 13:42:35 UTC (about 17 years ago)

Save all opened files with ONE click, or with script...

durumdara@gmail.com wrote:

I don't see any Windows downloads. Is it Linux platform dependent?

Bottom of the second section, "Where do I get it?"

http://www.ozemail.com.au/~hodsond/dbp-1.1.3.zip

The Windows version has problems with non-ascii file names, but otherwise should be OK.

durumdara@gmail.com
2007-11-22 16:29:52 UTC (about 17 years ago)

Save all opened files with ONE click, or with script...

durumdara@gmail.com wrote:

Hi!

Fu said:
Unbound variable...
In this time the MenuPoint not visible. Possible this caused by translated version of Gimp???

Thanks for your help: dd

Hi!

It is working now. I deleted all other scm files, and it is working. Very good thing, special thanks for you!

Last question: Can you combine this script with "Close Image after Save"? So the script working like this pseudo-code:

while OpenedImageCount > 0: img = GetImage(0)
img.Save()
img.Close()

????

Thanks for your help: dd

buralex@gmail.com
2007-11-23 04:08:53 UTC (about 17 years ago)

Save all opened files with ONE click, or with script...

saulgoode@flashingtwelve.brickfilms.com said on Nov 22, 2007 5:51 -0500 (in part):

(script-fu-register "script-fu-save-all-images" ">IMAGE
)

Now I'm being picky :-) ... is there a way to make this appear in the File menu with the other Save options (between Save as Template and Revert)?

Currently it appears at the bottom after Quit (using WinXp Gimp 2.4.2 in case its different on other platforms)

From gimp.org:

GIMP - Basic Scheme
"The parameters of script-fu-register may be divided into two groups. The first group of seven parameters must always be given. These are:

1. The name of the function. 2. The name of the script to be used as a menu entry. 3. A help string describing the function of the script. 4. The script author.
5. The script copyright.
6. Script date.
7. List of valid image types for the script. This only has a meaning on scripts operating on images that already exist." http://www.gimp.org/tutorials/Basic_Scheme/

btw: I accidentally created this script a Unicode file. AFAICT it gets silently ignored, though Gimp does seem to hold a lock on the file.

Regards ... Alec -- buralex-gmail

Sven Neumann
2007-11-23 08:57:27 UTC (about 17 years ago)

Save all opened files with ONE click, or with script...

Hi,

On Thu, 2007-11-22 at 22:08 -0500, buralex@gmail.com wrote:

saulgoode@flashingtwelve.brickfilms.com said on Nov 22, 2007 5:51 -0500 (in part):

(script-fu-register "script-fu-save-all-images" ">IMAGE
)

Now I'm being picky :-) ... is there a way to make this appear in the File menu with the other Save options (between Save as Template and Revert)?

Currently it appears at the bottom after Quit (using WinXp Gimp 2.4.2 in case its different on other platforms)

Sure, just register it as "s scripts.

Sven

saulgoode@flashingtwelve.brickfilms.com
2007-11-24 07:10:15 UTC (about 17 years ago)

Save all opened files with ONE click, or with script...

Sven Neumann wrote:
Sure, just register it as ")

Thanks, I was wondering how that worked.

Sven Neumann wrote:
Also the script should not be called "script-fu-save-all-images". Please use a different namespace when you are writing scripts to avoid name clashes with other people's scripts.

Personally, I find this script to be dangerous and hope it does not proliferate beyond the original poster's specific use case. But could you please explain a little further why the naming is improper?

saulgoode@flashingtwelve.brickfilms.com
2007-11-24 23:20:24 UTC (about 17 years ago)

Save all opened files with ONE click, or with script...

Sven Neumann wrote:

"script-fu-save-all-images" is a name in the script-fu namespace. This namespace should be kept for scripts that are distributed with Script-Fu. It would be safer to call your script for example "saulgoode-save-all-images". If we ever added a script called "script-fu-save-all-images" to GIMP, your script would not clash with it.

Thanks again for the information. It is a very reasonable policy of which I was unaware. From what I have seen, the vast majority of third-party Script-fu authors also are unaware of this and there is a Script-fu tutorial on GIMP.org which recommends using the "script-fu-" namespace (see below).

There is currently a fairly extensive effort ongoing to update older scripts to assure compatibility with the TinyScheme-based interpreter. Would you recommend that these updates be encouraged to avoid the "script-fu-" namespace? If so, can we perhaps recommend a namespace convention for third-party scripts that might be more standardized?

While using the script author's name as a base for the namespace would solve conflicts, perhaps we could also suggest a prefix to that so that third-party scripts would be easily recognized and grouped within the PDB browser (e.g., using "sf-author-" as a namespace).

========================== http://docs.gimp.org/en/gimp-using-script-fu-tutorial-first-script.html

3.4.4. Naming Conventions

...

It's GIMP convention to name your script functions script-fu-abc, because then when they're listed in the procedural database, they'll all show up under script-fu when you're listing the functions. This also helps distinguish them from plug-ins.