05-06-2022, 03:59 PM
(This post was last modified: 05-06-2022, 04:01 PM by programmer_ceds.)
(05-06-2022, 03:26 PM)bliss Wrote: I'm probably doing something stupid?
(Scheme and Script-Fu first timer)
Does
not return a string?Code:
(gimp-image-get-filename 1)
Script-Fu Procedure Browser says so at least.
Code:
> (string-length (gimp-image-get-filename 1))
Error: string-length: argument 1 must be: string
Thank you for your time and effort kind stranger!
I had to do:
Code:
(string-length (car(gimp-image-get-filename 1)))
Where the (car x) is the important part.
Seems to be a Lisp thing where everything returns a pair or a list and car selects the first element of a pair/list.
Try:
(string-length (car(gimp-image-get-filename 1)))
You need to look at the car and cadr functions that are used to fetch the return values of functions.
Better still, assuming that you have GIMP with Python, use Python for scripting instead - it's much less of a pain in the backside than script-fu!
Edit - you beat me to the answer. But do consider using Python instead.