Regular expression in gimp-buffers-get-list ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

i wrote this "Paste as Layer" script (registred as "<Image>/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.
_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux