def _send_string_clipboard(self, string: str, paste_command: model.SendMode):
backup = self.clipboard.text  <EOL>if backup is None:<EOL><INDENT>logger.warning("<STR_LIT>")<EOL><DEDENT>self.clipboard.text = string<EOL>try:<EOL><INDENT>self.mediator.send_string(paste_command.value)<EOL><DEDENT>finally:<EOL><INDENT>self.ungrab_keyboard()<EOL><DEDENT>self.__enqueue(self._restore_clipboard_text, backup)<EOL>
Use the clipboard to send a string.