请教一个等待在用户在buffer里输入的elisp写法

我不想让周围人看见微信发的一些隐私内容,就想到用emacs输入文本然后发送到微信中。我用的是doom emacs,于是就想在scratch buffer里面输入内容并复制,再用AppleScript粘贴到微信。但是不知道该怎么样先让我在scratch buffer里面输入然后再执行复制,请问在doom/open-scratch-bufferdoom/copy-buffer-contents之间应该添加什么呢?谢谢!

(defun wechat-tell()
  "send wechat with the frontmost people"
  (interactive)
  (doom/open-scratch-buffer)
  (doom/copy-buffer-contents "*doom:scratch*")
  (do-applescript(concat
                  "tell application \"WeChat\"\n"
                   "activate\n"
                   "tell application\"System Events\" to key code 9 using command down\n"
                   "tell application\"System Events\" to key code 36\n"
                   "tell application\"System Events\" to key code 36\n"
                   "end tell\n"
                   "tell application\"Emacs\" to activate\n"))
  (erase-buffer)
  (kill-buffer "*doom:scratch*"))

https://github.com/tecosaur/emacs-everywhere

最终决定写一个mode,一个函数做准备,另一个函数负责收尾

";-*- mode: wechat -*-"

;;;###autoload
(define-derived-mode wechat-mode text-mode
  "wechat"
  "Major mode for send wechat to front most.")

(defun wechat-tell()
  "send wechat with the frontmost people"
  (interactive)
  (pop-to-buffer "*wechat*")
  (wechat-mode))

(defun wechat-tell-end()
  (interactive)
  (doom/copy-buffer-contents "*wechat*")
  (do-applescript(concat
                  "tell application \"WeChat\" \n"
                  "activate \n"
                  "tell application \"System Events\" to key code 9 using command down\n"
                  "tell application \"System Events\" to key code 36\n"
                  "end tell \n"
                  "tell application \"Emacs\" to activate\n"))
  (erase-buffer)
  (kill-buffer "*wechat*")
  (evil-window-delete))

(map! :map wechat-mode-map
      :n "zz" #'wechat-tell-end)

(provide 'wechat-mode)

实现的很丑陋但是勉强实现了隐私需求,尽管只能和微信当前窗口聊天