Spacemacs-rocks
Spacemacs-rocks copied to clipboard
Spacemacs Rocks 第二季: Day 6
- 百度网盘: http://pan.baidu.com/s/1miLBw5E
- 优酷: http://v.youku.com/v_show/id_XMTU0NjYwNzQ3Mg==.html
- Youtube: https://www.youtube.com/watch?v=WIzWxTc1KUI
原帖地址:https://emacs-china.org/t/21-emacs/74
牛X,
准备听着入睡。。。。。。我以为上新了呢。。。。。。。。
hi, zilongshanren:
这段获取url的代码, 在我的环境下出现 message buffer "let: Applescript error 1"
环境 : mac mojave 10.14.5, emacs26.1, org-mode 9.1.9
错误提示很少, 我不知道如何处理, 望指教
(defun YOUR_NAME/retrieve-chrome-current-tab-url() "Get the URL of the active tab of the first window" (interactive) (let ((result (do-applescript (concat "set frontmostApplication to path to frontmost application\n" "tell application \"Google Chrome\"\n" " set theUrl to get URL of active tab of first window\n" " set theResult to (get theUrl) \n" "end tell\n" "activate application (frontmostApplication as text)\n" "set links to {}\n" "copy theResult to the end of links\n" "return links as string\n")))) (format "%s" (s-chop-suffix "\"" (s-chop-prefix "\"" result)))))