Hello,

You can do it this way. Tested by myself right now and working well:

$ gimp-2.9 -i -d -f -s -b "`cat script.scm` (simple-unsharp-mask
\"file.png\" 5.0 0.5 0)" -b '(gimp-quit 0)'

So basically you could have your small shell script call-gimp-function
with the following code inside:

------------------------------------------------------
#!/bin/sh

gimp-2.9 -i -d -f -s -b "`cat \"$1\"` $2" -b '(gimp-quit 0)'
------------------------------------------------------

Then you can call it this way:
$ ./call-gimp-function script.scm "(simple-unsharp-mask \"file.png\" 5.0 0.5 0)"

I think it should work well even if there are double quotes in the
definition script because I think cat escapes them before feeding the
contents to the main command.

Enjoy!

Jehan

P.S.: don't forget to replace gimp-2.9 in the script with your version
and to make your script executable.

On Fri, Aug 2, 2013 at 2:10 AM, Josef Wolf <[email protected]> wrote:
> Hello,
>
> I am trying to use gimp in batch mode. Unfortunately, I can't find any
> examples of how to do _real_ batch processing. All the examples on the
> net show how to integrate into the gui.
>
> I see that I can use the -b flag to invoke script-fu functions. But AFAICS,
> the script with the function definitions needs to reside somewhere in
> ~/gimp-x.y/scripts or something.
>
> In addition, I can't find a way to pass command line arguments to the called
> functions.
>
> Is there any way to define/execute functions? For example, I'd like to call
> simple-unsharp-mask from http://www.gimp.org/tutorials/Basic_Batch/ like this:
>
>  $ call-gimp-function script.scm simple-unsharp-mask file.png 5.0 0.5 0
>
> Is there any way to achieve this? Any hints?
>
> --
> Josef Wolf
> [email protected]
> _______________________________________________
> gimp-user-list mailing list
> List address:    [email protected]
> List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
_______________________________________________
gimp-user-list mailing list
List address:    [email protected]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list

Reply via email to