Post Reply 

Script fu passing parameters via command line without GUI

Sep 5, 2012, 11:53
Post: #1
Script fu passing parameters via command line without GUI
Hi friends,
I am a newbie to script-fu and need ur help on following.
I want to generate the comic book using the .scm file.
The file can be downloaded from here
" http://registry.gimp.org/node/15994 " and its defintions goes like
**
(define (script-fu-Comic-Book1
img
drawable
)
**
Now like the example on gimp batch mode page " gimp -i -b '(simple-unsharp-mask "foo.png" 5.0 0.5 0)' -b '(gimp-quit 0)' " .
I need to pass the image and drawable(?) to the script-fu-Comic-Book1 and generate the intended image.
Can anybody help me with this?
Find all posts by this user
Quote this message in a reply
Sep 5, 2012, 13:41
Post: #2
RE: Script fu passing parameters via command line without GUI
In fact you need to write a "wrapper" script that:

- loads the image from file, using parameter passed from the command line
- obtains the current drawable (easy!)
- passes these two (plus any other parameter necessary) to the script-fu-Comic-Book1, and runs it
- save the resulting image to file

The command line will therefore call your wrapper with the necessary parameters (at least the input file name).

If your Gimp install supports python and you feel more comfortable with it, you can write the wrapper script in python, you will still be able to call any necessary Scheme scripts.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Sep 6, 2012, 05:19
Post: #3
RE: Script fu passing parameters via command line without GUI
(Sep 5, 2012 13:41)ofnuts Wrote:  In fact you need to write a "wrapper" script that:

- loads the image from file, using parameter passed from the command line
- obtains the current drawable (easy!)
- passes these two (plus any other parameter necessary) to the script-fu-Comic-Book1, and runs it
- save the resulting image to file

The command line will therefore call your wrapper with the necessary parameters (at least the input file name).

If your Gimp install supports python and you feel more comfortable with it, you can write the wrapper script in python, you will still be able to call any necessary Scheme scripts.

Thanks for your reply.And it seems its necessary to write a python wrapper .Well I'v not tried the python but have to learn it now,hope it goes well.Please let me know if there are good tutorials on writing the pytyhon script for gimp.. Thanks alot.
Find all posts by this user
Quote this message in a reply
Oct 10, 2012, 13:49
Post: #4
RE: Script fu passing parameters via command line without GUI
(Sep 6, 2012 05:19)shrikant Wrote:  
(Sep 5, 2012 13:41)ofnuts Wrote:  In fact you need to write a "wrapper" script that:

- loads the image from file, using parameter passed from the command line
- obtains the current drawable (easy!)
- passes these two (plus any other parameter necessary) to the script-fu-Comic-Book1, and runs it
- save the resulting image to file

The command line will therefore call your wrapper with the necessary parameters (at least the input file name).

If your Gimp install supports python and you feel more comfortable with it, you can write the wrapper script in python, you will still be able to call any necessary Scheme scripts.

Thanks for your reply.And it seems its necessary to write a python wrapper .Well I'v not tried the python but have to learn it now,hope it goes well.Please let me know if there are good tutorials on writing the pytyhon script for gimp.. Thanks alot.

Hi ofnuts and everyone here could you plz help me with some examples in this scenario so that it will be more clear to me.
Find all posts by this user
Quote this message in a reply
Oct 10, 2012, 15:21
Post: #5
RE: Script fu passing parameters via command line without GUI
Someone else with a similar problem was helped here:
http://gimpforums.com/thread-a-script-fu...mmand-line

Which referred to previous thread, with an example script-fu script:
http://gimpforums.com/thread-batch-despe...37#pid8937

Kevin
Find all posts by this user
Quote this message in a reply
Oct 11, 2012, 04:56
Post: #6
RE: Script fu passing parameters via command line without GUI
Hello Kevin,
Thanks for the reply.I'll be trying my hands on this now and will report how I proceed.
Find all posts by this user
Quote this message in a reply
Oct 11, 2012, 17:10 (This post was last modified: Oct 11, 2012 17:10 by shrikant.)
Post: #7
RE: Script fu passing parameters via command line without GUI
Well, I got this script working .
Only issue :- The effect gets applied to the image through batch mode but the script gives execution error on verbose.So for the sake of completeness I am trying to figure that out.Otherwise my primary purpose is served.

Thanks a ton to everyone who helped.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How to close gimp with batch command? flixe 1 135 Jun 19, 2017 12:29
Last Post: ythgilb
  [Easy] Sobel plugin parameters t4u 2 212 Oct 7, 2014 19:09
Last Post: ofnuts
  Need help in running a gui script-fu via command line eyalzek 2 226 Oct 4, 2014 14:05
Last Post: eyalzek
  Color menuitems in script or plugin Barbie 4 385 Sep 29, 2014 09:51
Last Post: paynekj
  script-fu ok in gimp, not in commad line dominique 1 264 Sep 28, 2014 03:18
Last Post: dominique

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS