我不想让周围人看见微信发的一些隐私内容,就想到用emacs输入文本然后发送到微信中。我用的是doom emacs,于是就想在scratch buffer里面输入内容并复制,再用AppleScript粘贴到微信。但是不知道该怎么样先让我在scratch buffer里面输入然后再执行复制,请问在doom/open-scratch-buffer
和doom/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*"))