Previous | Next

Harder conditionals


(if (= (car (gimp-selection-is-empty img))
       FALSE)
    (do-stuff-to-selection)
    (gimp-message "Nothing is selected")
)

GIMP functions ALWAYS return a list. So anything you get back, whether it's a boolean, an image, a layer or what, use car to get the first element of that list.

And even then you're not done. Because you can't just say "if true." You have to test the result to see if it's equal to true.