Regular expression in gimp-buffers-get-list ?
Hi all,
i wrote this "Paste as Layer" script (registred as "/Edit/Paste
as/Paste as Layer"; its based on a script of Jonathan Stipe), it just
need a tweak to lower the the pasted layer to the last selected on.
But i got a problem with (buffers (gimp-buffers-get-list "*")).
I use this to check wether the clipboard is empty or not, so when the
user run this script on empty clipboard no error message will appear.
on buffers (gimp-buffers-get-list "*" the filter ("*") is a optional
regular expression, but without "*" i always get an error message and
with "*" it didn't work correct.
What is the correct regular expression for exepting anything? here is
the base of the script:
(gimp-image-undo-group-start img )
(let* (
(draw (car (gimp-image-get-active-drawable img )))
(buffers (gimp-buffers-get-list "*"))
(num-buffers (car buffers))
(buffer-array (cadr buffers))
)
(if (> num-buffers 0) ;if clipvoard is empty nothing will be done
(if (not (= (car (gimp-drawable-is-layer draw )) 0 ))
(gimp-floating-sel-to-layer (car (gimp-edit-paste draw 1 )))
(if (not (= (car (gimp-drawable-is-layer-mask draw )) 0 ))
(gimp-floating-sel-to-layer (car (gimp-edit-paste (car
(gimp-image-get-active-layer img )) 1 )))
(if (not (= (car (gimp-drawable-is-channel draw)) 0))
(gimp-floating-sel-to-layer (car (gimp-edit-paste (aref (cadr
(gimp-image-get-layers img )) 0 ) 1 )))
)
)
)
)
)
(gimp-displays-flush)
Thanx!
Bart.