Re: [Gimp-developer] Regular expression in gimp-buffers-get-list ?

2007-01-25 Thread Bart


Hi Sven,

i can't fix it, i can write/ fix scripts in python or scheme no problem 
at all but i can't do c or c++. Sorry.

Bart.

Sven Neumann schrieb:
 Hi,
 
 On Wed, 2007-01-24 at 17:07 +0100, Bart wrote:
 
 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.
 
 I think I already explained that the error messages are a bug. So what's
 all the fuss to work around it? Why not just help to get it fixed
 instead?
 
 
 Sven
 
 
 
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


[Gimp-developer] Regular expression in gimp-buffers-get-list ?

2007-01-24 Thread Bart

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@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer