Re: [Gimp-user] Trouble calling running batch script in Windows XP

2007-11-12 Thread Sam Kuper
Dear Saul,

Thanks for your help. I was eventually successful in running my batch GIMP
script from the Windows XP command line, by using either of the following
commands:


gimp-2.4 -i -b (batch-CUPify \D:\\Documents and
Settings\\spk30\\Desktop\\alison_sl1_dear_friend_backup\\*\) (gimp-quit 0)

gimp-2.4 -i -b (batch-CUPify \*.png\) (gimp-quit 0)


and altering the script to read thus:


; Batch apply the CUPify script

(define (batch-CUPify pattern)

  (let* (
(filelist (cadr (file-glob pattern 1

(while (not (null? filelist))
  (let* (
(filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image

; Erode the image
(plug-in-erode 1 image drawable 1 1 0.5 7 128 128)

; Photocopy the image
(plug-in-photocopy 1 image drawable 35.51 0.583 0.342 0.200)

; Erode the image
   (plug-in-erode 1 image drawable 1 1 0.5 7 128 128)

; Flush the display
(gimp-displays-flush)

; Save the image
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist
)

(script-fu-register batch-CUPify
Batch-CUPify
Make an image look like it was scanned to PDF by CUP
Sam Kuper
Sam Kuper
2007
GRAY*
SF-IMAGEImage 0
SF-DRAWABLE Layer to process 0)
; End script


Many thanks for the help,

Sam Kuper

On 10/11/2007, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:

 I do not believe that single-quoting a command line argument in Windows
 works the same as BASH (Linux). Try using double-quotes and escape any
 double-quotes which appear in your argument:

 gimp -i -b (batch-CUPify \*.png\) -b (gimp-quit 0)

 If you include directories in your path, also escape your backslashes:

 gimp -i -b (batch-CUPify \D:\\Documents and
 Settings\\spk30\\Desktop\\alison_sl1_dear_friend_backup\\*.png\) -b
 (gimp-quit 0)

 You may need to experiment as I do not run Windows and have no way of
 testing the commands.


  I am using GIMP 2.4.1 on Windows XP, and I am trying to run the script
 by
  going to the command prompt, changing to a directory full of .png files
 I
  want to process with the script, and entering the command:
 
  gimp-2.4 -i -b '(batch-CUPify *.png)' '(gimp-quit 0)'
 
  This gives me the following messages:
 
  GIMP-Error: Opening 'D:\Documents and
  Settings\spk30\Desktop\alison_sl1_dear_fri
  end_backup\*.png)'' failed: Invalid argument
 
  GIMP-Error: Opening 'D:\Documents and
  Settings\spk30\Desktop\alison_sl1_dear_fri
  end_backup\'(gimp-quit' failed: No such file or directory
 
  GIMP-Error: Opening 'D:\Documents and
  Settings\spk30\Desktop\alison_sl1_dear_fri
  end_backup\0)'' failed: No such file or directory
 
  No batch interpreter specified, using the default
  'plug-in-script-fu-eval'.
  batch command: executed successfully.
 
 
  I would be very grateful for any help you can offer.
 
  Many thanks in advance,
 
  Sam
  ___
  Gimp-user mailing list
  Gimp-user@lists.XCF.Berkeley.EDU
  https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
 
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Trouble calling running batch script in Windows XP

2007-11-12 Thread Kevin Cozens
Sam Kuper wrote:
 (define (batch-CUPify pattern)
[snip]
 )
 
 (script-fu-register batch-CUPify
 Batch-CUPify
 Make an image look like it was scanned to PDF by CUP
 Sam Kuper
 Sam Kuper
 2007
 GRAY*
 SF-IMAGEImage 0
 SF-DRAWABLE Layer to process 0)

Good to know you finally got your script running in batch mode.

For future reference, if you are using a script in batch mode only, you don't 
need the script-fu-register block. The register block is only needed if you 
want to run your scripts by selecting it from a menu within GIMP.

Also, the argument list expected by your script, as defined above, does not 
match the argument list you have listed in the register block. Again, not 
important when running the script from batch mode but it could cause you 
problems in the future when writing scripts to be run from a menu selection 
within GIMP.

-- 
Cheers!

Kevin.

http://www.ve3syb.ca/   |What are we going to do today, Borg?
Owner of Elecraft K2 #2172  |Same thing we always do, Pinkutus:
 |  Try to assimilate the world!
#include disclaimer/favourite |  -Pinkutus  the Borg
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Trouble calling running batch script in Windows XP

2007-11-12 Thread Sven Neumann
Hi,

On Mon, 2007-11-12 at 11:19 -0500, Kevin Cozens wrote:

 For future reference, if you are using a script in batch mode only, you don't 
 need the script-fu-register block. The register block is only needed if you 
 want to run your scripts by selecting it from a menu within GIMP.

That is not entirely correct. You can only omit the registration for
Script-Fu scripts if you are using the default batch interpreter which
happens to be Script-Fu. For scripts written in other languages, or if
you use a different batch interpreter, the script procedure has to be
registered with the PDB and that is what script-fu-register is doing.


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Trouble calling running batch script in Windows XP

2007-11-10 Thread saulgoode
I do not believe that single-quoting a command line argument in Windows
works the same as BASH (Linux). Try using double-quotes and escape any
double-quotes which appear in your argument:

gimp -i -b (batch-CUPify \*.png\) -b (gimp-quit 0)

If you include directories in your path, also escape your backslashes:

gimp -i -b (batch-CUPify \D:\\Documents and
Settings\\spk30\\Desktop\\alison_sl1_dear_friend_backup\\*.png\) -b
(gimp-quit 0)

You may need to experiment as I do not run Windows and have no way of
testing the commands.


 I am using GIMP 2.4.1 on Windows XP, and I am trying to run the script by
 going to the command prompt, changing to a directory full of .png files I
 want to process with the script, and entering the command:

 gimp-2.4 -i -b '(batch-CUPify *.png)' '(gimp-quit 0)'

 This gives me the following messages:

 GIMP-Error: Opening 'D:\Documents and
 Settings\spk30\Desktop\alison_sl1_dear_fri
 end_backup\*.png)'' failed: Invalid argument

 GIMP-Error: Opening 'D:\Documents and
 Settings\spk30\Desktop\alison_sl1_dear_fri
 end_backup\'(gimp-quit' failed: No such file or directory

 GIMP-Error: Opening 'D:\Documents and
 Settings\spk30\Desktop\alison_sl1_dear_fri
 end_backup\0)'' failed: No such file or directory

 No batch interpreter specified, using the default
 'plug-in-script-fu-eval'.
 batch command: executed successfully.


 I would be very grateful for any help you can offer.

 Many thanks in advance,

 Sam
 ___
 Gimp-user mailing list
 Gimp-user@lists.XCF.Berkeley.EDU
 https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user



___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Trouble calling running batch script in Windows XP

2007-11-08 Thread Sam Kuper
Dear all,

I have been having difficulty running the following batch script:

; --
; BEGIN SCRIPT
; --

(define (batch-CUPify pattern
  image
  drawable)

  (let* (
(filelist (cadr (file-glob pattern 1

(while (not (null? filelist))
  (let* (
(filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image

; Erode the image
(plug-in-erode 1 image drawable 1 1 0.5 7 128 128)

; Photocopy the image
(plug-in-photocopy 1 image drawable 35.51 0.583 0.342 0.200)

; Erode the image
   (plug-in-erode 1 image drawable 1 1 0.5 7 128 128)

; Flush the display
(gimp-displays-flush)

; Save the image
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist
)

(script-fu-register batch-CUPify
Batch-CUPify
Make an image look like it was scanned to PDF by CUP
Sam Kuper
Sam Kuper
2007
GRAY*
SF-IMAGEImage 0
SF-DRAWABLE Layer to process 0)


; --
; END SCRIPT
; --


I am using GIMP 2.4.1 on Windows XP, and I am trying to run the script by
going to the command prompt, changing to a directory full of .png files I
want to process with the script, and entering the command:

gimp-2.4 -i -b '(batch-CUPify *.png)' '(gimp-quit 0)'

This gives me the following messages:

GIMP-Error: Opening 'D:\Documents and
Settings\spk30\Desktop\alison_sl1_dear_fri
end_backup\*.png)'' failed: Invalid argument

GIMP-Error: Opening 'D:\Documents and
Settings\spk30\Desktop\alison_sl1_dear_fri
end_backup\'(gimp-quit' failed: No such file or directory

GIMP-Error: Opening 'D:\Documents and
Settings\spk30\Desktop\alison_sl1_dear_fri
end_backup\0)'' failed: No such file or directory

No batch interpreter specified, using the default 'plug-in-script-fu-eval'.
batch command: executed successfully.


I would be very grateful for any help you can offer.

Many thanks in advance,

Sam
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Trouble calling running batch script in Windows XP

2007-11-08 Thread Kevin Cozens
Sam Kuper wrote:
 I have been having difficulty running the following batch script:
 
 ; --
 ; BEGIN SCRIPT
 ; --
 
 (define (batch-CUPify pattern
   image
   drawable)
[snip]
 gimp-2.4 -i -b '(batch-CUPify *.png)' '(gimp-quit 0)'

I have only taken a quick look at the script. The most obvious problem is that 
you defined it as needing three parameters and only pass it one on the command 
line. Based on what I see in the script and how you are trying to use it you 
don't need the image and drawable parameters.

If you are only going to use this script via batch mode you don't need the 
register block.

-- 
Cheers!

Kevin.

http://www.ve3syb.ca/   |What are we going to do today, Borg?
Owner of Elecraft K2 #2172  |Same thing we always do, Pinkutus:
 |  Try to assimilate the world!
#include disclaimer/favourite |  -Pinkutus  the Borg
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Trouble calling running batch script in Windows XP

2007-11-08 Thread Sam Kuper
Dear Sven,

Running the same command in the same directory but using MinGW instead of
the Windows XP Command Prompt. This gives me the following messages:

No batch interpreter specified, using the default 'plug-in-script-fu-eval'.
batch command: experienced an execution error.

I hope this information may be of some help in solving the problem I'm
having.

Many thanks again for your help,

Sam


On 08/11/2007, Sam Kuper [EMAIL PROTECTED] wrote:

 Dear Sven,

 Thank you. However, I still receive the following messages:

 GIMP-Error: Opening 'D:\Documents and
 Settings\spk30\Desktop\alison_sl1_dear_friend_backup\*.png)'' failed:
 Invalid argument

 GIMP-Error: Opening 'D:\Documents and
 Settings\spk30\Desktop\alison_sl1_dear_friend_backup\0)'' failed: No such
 file or directory

 No batch interpreter specified, using the default
 'plug-in-script-fu-eval'.
 batch command: executed successfully.
 batch command: executed successfully.

 Is this because I need to escape the right parenthesis and double-quote
 mark somehow?

 Many thanks,

 Sam




 On 08/11/2007, Sven Neumann [EMAIL PROTECTED] wrote:
 
  Hi,
 
  On Thu, 2007-11-08 at 15:17 +, Sam Kuper wrote:
 
   gimp-2.4 -i -b '(batch-CUPify *.png)' '(gimp-quit 0)'
 
  The correct syntax to pass multiple batch commands to GIMP 2.4 is:
 
  gimp-2.4 -i -b '(batch-CUPify *.png)' -b '(gimp-quit 0)'
 
  In other words, only one command per --batch or -b option. But you may
  use this option several times.
 
 
  Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Trouble calling running batch script in Windows XP

2007-11-08 Thread Sven Neumann
Hi,

On Thu, 2007-11-08 at 15:17 +, Sam Kuper wrote:

 gimp-2.4 -i -b '(batch-CUPify *.png)' '(gimp-quit 0)'

The correct syntax to pass multiple batch commands to GIMP 2.4 is:

 gimp-2.4 -i -b '(batch-CUPify *.png)' -b '(gimp-quit 0)'

In other words, only one command per --batch or -b option. But you may
use this option several times.


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Trouble calling running batch script in Windows XP

2007-11-08 Thread Sam Kuper
Dear Sven,

Thank you. However, I still receive the following messages:

GIMP-Error: Opening 'D:\Documents and
Settings\spk30\Desktop\alison_sl1_dear_friend_backup\*.png)'' failed:
Invalid argument

GIMP-Error: Opening 'D:\Documents and
Settings\spk30\Desktop\alison_sl1_dear_friend_backup\0)'' failed: No such
file or directory

No batch interpreter specified, using the default 'plug-in-script-fu-eval'.
batch command: executed successfully.
batch command: executed successfully.

Is this because I need to escape the right parenthesis and double-quote mark
somehow?

Many thanks,

Sam




On 08/11/2007, Sven Neumann [EMAIL PROTECTED] wrote:

 Hi,

 On Thu, 2007-11-08 at 15:17 +, Sam Kuper wrote:

  gimp-2.4 -i -b '(batch-CUPify *.png)' '(gimp-quit 0)'

 The correct syntax to pass multiple batch commands to GIMP 2.4 is:

 gimp-2.4 -i -b '(batch-CUPify *.png)' -b '(gimp-quit 0)'

 In other words, only one command per --batch or -b option. But you may
 use this option several times.


 Sven





-- 
Mr Sam Pablo Kuper BSc MRI
Research Assistant
Darwin Correspondence Project
Cambridge University Library
West Road
Cambridge CB3 9DR
[EMAIL PROTECTED]
Office: +44 (0)1223 333008
Mobile: +44 (0) 7971858176
www.darwinproject.ac.uk
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user