code: def grabclipboard():
      if sys.platform == "darwin":
          fh, filepath = tempfile.mkstemp(".jpg")
          os.close(fh)
          commands = [
              'set theFile to (open for access POSIX file "'
              + filepath
              + '" with write permission)',
              "try",
              "    write (the clipboard as JPEG picture) to theFile",
              "end try",
              "close access theFile",
          ]
          script = ["osascript"]
          for command in commands:
              script += ["-e", command]
          subprocess.call(script)
  
          im = None
          if os.stat(filepath).st_size != 0:
              im = Image.open(filepath)
              im.load()
          os.unlink(filepath)
          return im
      else:
          data = Image.core.grabclipboard()
          if isinstance(data, bytes):
              from . import BmpImagePlugin
              import io
  
              return BmpImagePlugin.DibImageFile(io.BytesIO(data))
          return data
  
imports: import sys
  from .None import Image
label_desc: Use image node_id 2 for calling a global function with example usage: grabclipboard() and returns: im, data, BmpImagePlugin