Gimp-Forum.net
[Solved] How to modify this script-fu? - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: [Solved] How to modify this script-fu? (/Thread-Solved-How-to-modify-this-script-fu)



[Solved] How to modify this script-fu? - boolbilam - 08-24-2017

Hi,

I use this script:





Code:
((define (script-fu-logo inImage inLogo )
(let*
(
(calque (car (gimp-file-load-layer 1 inImage inLogo)))
)
(gimp-image-add-layer inImage calque 0)
(gimp-image-flatten inImage)
) ; fin let*
) ; fin define


(script-fu-register "script-fu-logo"; name
"<Image>/MyScripts/logo" ; position in menu
"test script"; commentary
""; author
"" ;
"" ;date
"" ;
SF-IMAGE "inImage" 0
SF-FILENAME "inLogo" (string-append "" gimp-data-dir "/scripts/images/logo.png")
)

I wish that this script only use the logo.png, without asking it.

Do you know how to do that ?


RE: How to modify this script-fu? - Kevin - 08-24-2017

In that case
  1. Remove the SF-FILENAME paramter from the script-fu-register section
  2. Remove the inLogo parameter from the define of script-fu-logo
  3. Assign inLogo to the fixed filepath
Code:
((define (script-fu-logo inImage)
(let*
(
 (inLogo (string-append "" gimp-data-dir "/scripts/images/logo.png"))
(calque (car (gimp-file-load-layer 1 inImage inLogo)))
)
(gimp-image-add-layer inImage calque 0)
(gimp-image-flatten inImage)
) ; fin let*
) ; fin define


(script-fu-register "script-fu-logo"; name
"<Image>/MyScripts/logo" ; position in menu
"test script"; commentary
""; author
"" ;
"" ;date
"" ;
SF-IMAGE "inImage" 0
)



RE: How to modify this script-fu? - boolbilam - 08-24-2017

Thank you ! I didn' manage to do that , simply beacouse I forgot the second step you mentionned... :/

Now, it's perfect !