Google
  Web www.spinics.net

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


> 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@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

[Home]     [GIMP Development]     [Video For Linux]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Yosemite Book Store]     [gtk]     [KDE]     [Scanner]     [Gimp's Home]     [Gimp Docs]     [Gimp on Windows]     [Steve's Art]     [Webcams]     [Share Your Images]     [Free Online Dating]     [Script Fu]

Add to Google amazon