Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

script-fu loops

240 views
Skip to first unread message

staci....@gmail.com

unread,
Jun 25, 2008, 2:31:52 PM6/25/08
to
I'm trying to write a script that contains a loop, but am having
difficulties with the looping construct. When running the script, I
get the following error: "Error: eval: unbound variable: while"

Things I've tried so far:
- I've created a new script with just a loop to try to isolate the
issue.
- I have downloaded and installed the newest GIMP (2.4.6), running on
Windows XP.
- web search: I did find a reference on the web (http://www.ve3syb.ca/
wiki/doku.php?id=software:sf:updating-scripts) that 'while' loops
should now be 'do' loops, since the incorporation of TinyScheme.
However, I get the same error when trying to use a do loop. However,
scripts I've downloaded use while, so perhaps this is an obsolete
comment?
- I downloaded the latest version of the FX Foundry scripts, to see if
they run. Many of these have while loops in them. I've tried to run
several, and get various errors -- but none of them related to the
while loop. Is it possible something is not installed or configured
correctly on my system?

Test script follows:

(define (script-fu-test-while)
( let* (
(i 0)
)
(while (< i 10)
(set! i (+ i 1))
)
))

Any suggestions are greatly appreciated!
Staci

staci....@gmail.com

unread,
Jun 26, 2008, 11:36:43 AM6/26/08
to

I found the problem, and will post the resolution here for anyone else
having this issue.

Turns out many (most?) scripts I downloaded failed, also with an error
of : "Error: eval: unbound variable: ___", where ____ would be various
things, such as caar, cadr, and other macro type things.

Upon more research, I discovered that these functions are defined in
init.scm, which is part of TinyScheme. Apparently GIMP has renamed
this file to be script-fu.init. This file is located (for windows),
in the \\share\gimp\2.0\scripts directory. By adding this directory
to the GIMP preferences for where to look for scripts (file-
>preferences->folders->scripts), the init file is apparently loaded
and things such as caar, cadr, and while can be used!!

0 new messages