init python: import inspect import pygame.scrap import re def to_clipboard(event, **kwargs): if event == "begin": d = inspect.currentframe().f_back.f_locals line = "[%s] %s" % (d.get("who"), d.get("what")) line = line.replace('[None]', '') line = re.sub(r'{.+?}', '', line) pygame.scrap.put(pygame.scrap.SCRAP_TEXT, line.encode("utf-8")) config.all_character_callbacks.append(to_clipboard)