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

Script-fu and menu

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.

1 of 1 message available
Toggle history

Please log in to manage your subscriptions.

Script-fu and menu J.Filby 11 Apr 20:58
J.Filby
2005-04-11 20:58:27 UTC (about 19 years ago)

Script-fu and menu

Hi,
starting from a script posted on this list I wrote the one below that applies colorize tool to a group of files. The script can be called from the menu, but when I try to run it a second time, the item in the menu becomes grey and I have to refresh the scripts to run it again. Someone can help me to find the problem? Thanks, J.

;; batch-convert-colorize.scm -- convert a set of files to index ;; simple batch script for GIMP 2.2
;;
;; call it from the command-line using a line like the following: ;; gimp -i -b "(script-fu-batch-convert-index \"/home/user/images\" \"/*.png\" 180 50 0 )" "(gimp-quit 0)" ;; or from menu xtns -> script-fu -> Batch -> Colorize ;;

(define (script-fu-batch-colorize dir pat_file hue saturation lightness) (set! pattern (string-append dir pat_file)) (let* ((filelist (cadr (file-glob pattern 1)))) (while filelist
(let* ((filename (car filelist)) (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) (drawable (car (gimp-image-get-active-layer image)))) (gimp-colorize drawable hue saturation lightness) (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename) (gimp-image-delete image)) (set! filelist (cdr filelist)))))
(script-fu-register "script-fu-batch-colorize" _"Colorize"
"Colorize a set of files" ""
""
"10/04/2005"
"RGBA"
SF-DIRNAME _"Directory with files" "/home/user/images" SF-STRING _"Pattern (put a / before it)" "/*.png" SF-ADJUSTMENT _"Hue" '(180 0 360 1 10 0 0) SF-ADJUSTMENT _"Saturation" '(50 0 100 1 10 0 0) SF-ADJUSTMENT _"Lightness" '(0 -100 100 1 10 0 0) )
(script-fu-menu-register "script-fu-batch-colorize" _"/Xtns/Script-Fu/Batch")