脚本fu'未绑定变量'参数错误

问题描述 投票:6回答:3

所以我尝试运行本教程中的批处理代码:http://www.gimp.org/tutorials/Basic_Batch/

我将其复制并保存到.gimp-2.8脚本文件夹中

  (define (batch-unsharp-mask pattern
                              radius
                              amount
                              threshold)
  (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))))
             (plug-in-unsharp-mask RUN-NONINTERACTIVE
                                   image drawable radius amount threshold)
             (gimp-file-save RUN-NONINTERACTIVE
                             image drawable filename filename)
             (gimp-image-delete image))
           (set! filelist (cdr filelist)))))

然后运行命令:

gimp-2.8 -i -b '(batch-unsharp-mask "*.png" 5.0 0.5 0)' -b '(gimp-quit 0)'

但是我得到了错误

Error: ( : 1) eval: unbound variable: *.png

这似乎不是脚本的问题;可能是我称呼它的方式或我错过了一些东西,但我无法弄明白。

gimp script-fu
3个回答
2
投票

我知道已经有四个长的月了,但我只是在用我编写的gimp(2.8)剧本进行战斗并获得反复出现

batch command experienced an execution error:
Error: ( : 32578) eval: unbound variable: while 

事实证明,在我急于整合脚本目录时,我删除了对/usr/share/gimp/2.0/scripts的引用。显然,该目录中的某些内容定义了“while”

编辑 - >首选项 - >文件夹 - >脚本


2
投票

得到原始脚本在gimp 2.8 ubuntu 14.04lts工作只需要将换行符复制并粘贴在一起。我无法粘贴这个,因此线条没有被破坏,只需删除空行,因为它们是一个发布异常。将脚本放在〜/ .gimp-2.9 / scripts中使用它来删除haze run as gimp -i -b'(batch-unsharp-mask“* .JPG”100 0.3 0)' - b'(gimp-quit 0)'

(define (batch-unsharp-mask pattern radius amount threshold)
(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))))
  (plug-in-unsharp-mask RUN-NONINTERACTIVE  image drawable radius amount threshold)
  (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
  (gimp-image-delete image))
(set! filelist (cdr filelist)))))

0
投票

我通过确认脚本的名称来解决此错误。我从现有脚本复制了我的脚本,名称是重复的。更新了我的脚本名称后,错误就消失了,一切都开始了。

您必须具有唯一的脚本名称,其中包括define名称

© www.soinside.com 2019 - 2024. All rights reserved.