Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

HEELPPP. Python script breaking

Fri Apr 28, 2017 4:40 pm

Okay, so I'm trying to add a new black layer as a background, but for some reason this line breaks my script:

bg = pdb.gimp_layer_new(img, img.width, img.height, 3, “BG”, 100, 0)

What am I doing wrong??

Re: HEELPPP. Python script breaking

Fri Apr 28, 2017 5:13 pm

Hmm even when I comment the line out with #, gimp still doesn't even recognize the plugin. But if I completely delete the line, everything works fine.

Re: HEELPPP. Python script breaking

Fri Apr 28, 2017 7:33 pm

I dont think you need the double quotes around BG.

Re: HEELPPP. Python script breaking

Sat Apr 29, 2017 1:49 am

Rod wrote:I dont think you need the double quotes around BG.

Quotes are necessary, this is a string literal (unless there is a BG variable somewhere).

But the quotes as pasted above are wrong, these are not straight double-quotes ("") but opening/closing double quotes (“”).

Do not use a word processor to write code because it tries to be clever when it shouldn't, use a real programmer's editor (Notepadd++ or else) (which will also do real-time syntax highlighting, help with indentation, etc...

Re: HEELPPP. Python script breaking

Sat Apr 29, 2017 12:48 pm

OMG! I had no idea there were different kinds of double quotes. Thank you!!!
Post a reply