RSS/Atom feed Twitter
Site is read-only, email is disabled

Regular expression in gimp-buffers-get-list ?

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

Regular expression in gimp-buffers-get-list ? Bart 24 Jan 17:07
  Regular expression in gimp-buffers-get-list ? Sven Neumann 24 Jan 19:53
   Regular expression in gimp-buffers-get-list ? Bart 25 Jan 10:42
    Regular expression in gimp-buffers-get-list ? Sven Neumann 27 Jan 00:03
Bart
2007-01-24 17:07:54 UTC (about 17 years ago)

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.

Sven Neumann
2007-01-24 19:53:30 UTC (about 17 years ago)

Regular expression in gimp-buffers-get-list ?

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

Bart
2007-01-25 10:42:50 UTC (about 17 years ago)

Regular expression in gimp-buffers-get-list ?

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

Sven Neumann
2007-01-27 00:03:47 UTC (about 17 years ago)

Regular expression in gimp-buffers-get-list ?

Hi,

On Thu, 2007-01-25 at 10:42 +0100, Bart wrote:

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.

It's still a waste of your and our time to work around it. And you could help. The problem here is really not writing the code. It's deciding how we can handle this best. Should the PDB function return -1 and succeed? Does that have the potential to break existing scripts?

Sven