(03-12-2023, 12:13 AM)steven Brazzale Wrote: Thanks For That Ofnuts.
I've got it to work, but not with
making sure the ID matches the Gimp Image number - i keep getting the error :-Code:
image=image=[x for x in gimp.image_list() if image.ID==5][0]
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'image' is not defined
But I am only using one image, so I can just use
Also is there anyway I can get this number directly into the clipboard?Code:
theImage = gimp.image_list()[0]
Cheers
Steven
1) Sorry, typo, only one image=:
Code:
image=[x for x in gimp.image_list() if image.ID==5][0]
2) Yes, you can hardcode gimp.image_list()[0] but you'll get burned sooner or later. Of course if you do a true plugin instead of pasting code in the Python console you get the image passed as a plugin parameter.
3) Possibly, but this is heavily system dependent. On Linux, there is a CLI utility to stuff things in the clipboard and it can be called from Python. I don't know if it is as simple in Windows (or even possible). But IMHO you could skip the clipboard and write directly in a file.