首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在参数上执行脚本fu 'unbound variable‘错误

在参数上执行脚本fu 'unbound variable‘错误
EN

Stack Overflow用户
提问于 2014-03-06 07:59:56
回答 4查看 8K关注 0票数 10

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

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

代码语言:javascript
复制
  (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)))))

并运行以下命令:

代码语言:javascript
复制
gimp-2.8 -i -b '(batch-unsharp-mask "*.png" 5.0 0.5 0)' -b '(gimp-quit 0)'

但是我得到了一个错误

代码语言:javascript
复制
Error: ( : 1) eval: unbound variable: *.png

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

EN

回答 4

Stack Overflow用户

发布于 2014-07-07 01:39:37

我知道这已经是漫长的四个月了,但我只是在与我写的一个笨拙的(2.8)脚本作斗争,并得到了一个反复出现的脚本

代码语言:javascript
复制
batch command experienced an execution error:
Error: ( : 32578) eval: unbound variable: while 

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

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

票数 3
EN

Stack Overflow用户

发布于 2015-04-29 06:52:05

让原始脚本在gimp 2.8 ubuntu 14.04中工作,只需复制并粘贴换行符就可以了。我在粘贴时遇到了问题,这样行就不会断掉,只需删除空行,因为它们是一个张贴异常。将脚本放在~/.gimp-2.9/scripts中,并使用此脚本删除雾霾作为gimp -i -b '(batch-unsharp-mask "*.JPG“100 0.3 0)‘-b '(gimp-quit 0)’

代码语言:javascript
复制
(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)))))
票数 1
EN

Stack Overflow用户

发布于 2018-03-26 04:15:32

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

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22212107

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档