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

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

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

durumdara@gmail.com
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



_______________________________________________
Gimp-user mailing list
[hidden email]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Reply | Threaded
Open this post in threaded view
|

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

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

--
〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
Choi, JiHui
http://Mr-Dust.pe.kr
http://GIMP.kr
_______________________________________________
Gimp-user mailing list
[hidden email]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Reply | Threaded
Open this post in threaded view
|

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

Joao S. O. Bueno Calligaris
In reply to this post by durumdara@gmail.com
On Thursday 22 November 2007 09:25:50 am [hidden email] 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
>
>
>
> _______________________________________________
> Gimp-user mailing list
> [hidden email]
> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


_______________________________________________
Gimp-user mailing list
[hidden email]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Reply | Threaded
Open this post in threaded view
|

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

durumdara@gmail.com
In reply to this post by Choi, JiHui
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

_______________________________________________
Gimp-user mailing list
[hidden email]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Reply | Threaded
Open this post in threaded view
|

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

saulgoode
In reply to this post by durumdara@gmail.com
> 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"
 "<Image>/File/Save ALL"
 "Save all opened images"
 "Saul Goode"
 "Saul Goode"
 "11/21/2006"
 ""
 )

_______________________________________________
Gimp-user mailing list
[hidden email]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Reply | Threaded
Open this post in threaded view
|

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

durumdara@gmail.com
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


_______________________________________________
Gimp-user mailing list
[hidden email]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Reply | Threaded
Open this post in threaded view
|

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

David Hodson
In reply to this post by durumdara@gmail.com
[hidden email] 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.


--
David Hodson  --  this night wounds time
_______________________________________________
Gimp-user mailing list
[hidden email]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Reply | Threaded
Open this post in threaded view
|

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

durumdara@gmail.com
In reply to this post by durumdara@gmail.com
[hidden email] 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

_______________________________________________
Gimp-user mailing list
[hidden email]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Reply | Threaded
Open this post in threaded view
|

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

Alec Burgess
In reply to this post by saulgoode
[hidden email] said on Nov 22, 2007 5:51 -0500 (in part):
(script-fu-register "script-fu-save-all-images"
">IMAGE</File/Save ALL"
"Save all opened images"
"Saul Goode"
"Saul Goode"
"11/21/2006"
""
)
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
-- 

_______________________________________________
Gimp-user mailing list
[hidden email]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Reply | Threaded
Open this post in threaded view
|

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

Sven Neumann
Hi,

On Thu, 2007-11-22 at 22:08 -0500, [hidden email] wrote:

> [hidden email] said on Nov 22, 2007 5:51
> -0500 (in part):
> > (script-fu-register "script-fu-save-all-images"
> > ">IMAGE</File/Save ALL"
> > "Save all opened images"
> > "Saul Goode"
> > "Saul Goode"
> > "11/21/2006"
> > ""
> > )
> 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 "<Image></File/Save/Save All". Or, even
better, just use "Save All" where the full menu path was given and add
the line

 (script-fu-menu-register "script-fu-save-all-images"
                          "<Image></File/Save")

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.


Sven


_______________________________________________
Gimp-user mailing list
[hidden email]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Reply | Threaded
Open this post in threaded view
|

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

saulgoode
> Sven Neumann wrote:
> Sure, just register it as "<Image></File/Save/Save All". Or, even
> better, just use "Save All" where the full menu path was given and add
> the line
>
>  (script-fu-menu-register "script-fu-save-all-images"
>                           "<Image></File/Save")

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?



_______________________________________________
Gimp-user mailing list
[hidden email]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Reply | Threaded
Open this post in threaded view
|

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

saulgoode

> 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.

_______________________________________________
Gimp-user mailing list
[hidden email]
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user