【问题标题】:Script fu 'unbound variable' error on arguments参数上的脚本 fu“未绑定变量”错误
【发布时间】:2014-04-08 08:35:54
【问题描述】:

所以我尝试运行本教程中的批处理代码: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

这似乎不是脚本的问题;可能是我称呼它的方式,或者我遗漏了一些东西,但我无法弄清楚。

【问题讨论】:

  • 此页面没有提供解决问题中所述错误的答案...........错误:(:1)评估:未绑定变量:* .png
  • 你找到解决办法了吗?

标签: gimp script-fu


【解决方案1】:

帮助我确保脚本具有正确的扩展名.scm

【讨论】:

    【解决方案2】:

    我通过确认我的脚本名称解决了这个错误。我从现有脚本中复制了我的脚本,但名称重复。在我更新了我的脚本名称后,错误消失了,一切都开始工作了。

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

    【讨论】:

      【解决方案3】:

      让原始脚本在 gimp 2.8 ubuntu 14.04lts 中工作 只需将换行符复制并粘贴到一起。我在粘贴时遇到问题,因此行不会中断,只需删除空白行,因为它们是发布异常。将脚本放在 ~/.gimp-2.9/scripts 用它来去除雾霾 运行为 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)))))
      

      【讨论】:

      • 就是这个。 Gimp 2.10,Ubuntu 19.04。
      【解决方案4】:

      我知道这已经过去了四个月,但我只是在与我编写的 gimp (2.8) 脚本作斗争,并且反复出现

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

      事实证明,在我匆忙合并脚本目录时,我删除了对 /usr/share/gimp/2.0/scripts 的引用。显然该目录中有一些东西定义了“while”

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-07-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-04-12
        相关资源
        最近更新 更多