On Fr, Aug 02, 2013 at 03:32:55 +1200, Jehan Pagès wrote:
> 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)"

Thanks for your suggestion, Jehan!

In fact, that's what I'm currently doing. But I thought there must be a better
way, since this is very prone to quoting errors. I got hidden badly when I
tried to pass a color definition as a quoted scheme list =:8O

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

I'd rather redirect stdin instead of using cat.

PS: where can I find information about how to access operating system (files,
directories, environment, etc) from script-fu? I've been searching for
TinyScheme ducumentation but could not find anyting. There seems to be
something like txn extensions and re extensions. But they don't seem to be
available from script-fu? Any hints?

-- 
Josef Wolf
j...@raven.inka.de
_______________________________________________
gimp-user-list mailing list
List address:    gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list

Reply via email to