Gimp-Forum.net

Full Version: Pasting from the Clipboard created by PrtScr key
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have been unable to discover a way for a script to paste from the clipboard (clipboard image created by "PrtScr" key). I can obviously use the edit>paste option to do it manually (which works), but the procedure in a script using "gimp-edit-paste-as-new-image" does not return an image. I realise that the procedure notes state

"This procedure pastes a copy of the internal GIMP edit buffer to a new image. The GIMP edit buffer will be empty unless a call was previously made to either 'gimp-edit-cut' or 'gimp-edit-copy'. This procedure returns the new image or -1 if the edit buffer was empty."

and the clipboard is not mentioned (whereas it is in pasting brushes and patterns).

I have not been able to find anything on this after many hours of searching.

My question is "Is it possible in TinyScheme/ScriptFu?"
The paste-as-brush and paste-as-pattern are scripts so if they can do it, Python can do it. Unfortunately, they both start with:

Code:
(let* ((pattern-image (car (gimp-edit-paste-as-new-image)))

so you are out of luck. I am not too surprised by this, the Gimp scripts/plugins are purposely unable to interfere with the UI, and copy/pasting to the system clipboard would be such a case.

OTOH Gimp has its own screenshot function (Filer>Create>Screenshot), and my usual screenshot utility saves the image in /tmp and calls Gimp on it.