There are some errors in your
let* bindings:
Quote:
(dummy-variable-to-make-let-happy 0)
(visibles (get-visibles image))
(set! visibles (cdr visibles))
(current-layer -1)
(copied-layer -1)
(horizontal-rotation 0)
(vertical-rotation 0)
(new-name "")
(frame 0)
The
dummy-variable should not be necessary and should be removed.
The
set! should be removed. Its presence should generate a syntax error but what actually happens with the Script-fu interpreter is a variable named 'set!' is created and initialized to the value of 'visibles'; the '(cdr visibles)' is ignored. This 'set!' variable has no effect since 'set!' is a keyword and never evaluated as a variable.
The other bindings should be supplied with initial values per the Scheme specification. The fact that the Script-fu does not flag this as a syntax error is a bug and the actual result is not consistent (which is probably the reason you were compelled to introduce the dummy variable). It does not matter what the initial value is, but it should be present. Even if your script works without the initial value on your machine, it may not on someone else's, or with different (including future) versions of GIMP.