Grab link from Mac Apps.
- Chrome
- Safari
- Firefox
- Finder
- Terminal
- Skim
- qutebrowser
Plain: https://www.wikipedia.org/
Markdown: [Wikipedia](https://www.wikipedia.org/)
Org: [[https://www.wikipedia.org/][Wikipedia]]
HTML: <a href="https://www.wikipedia.org/">Wikipedia</a>
Prompt for an application to grab a link from and prompt for a link type to insert as, then insert it at point.
Grab link from App and return it in LINK-TYPE.
(grab-mac-link 'chrome)
⇒ "https://www.wikipedia.org/"
(grab-mac-link 'chrome 'plain)
⇒ "https://www.wikipedia.org/"
(grab-mac-link 'chrome 'markdown)
⇒ "[Wikipedia](https://www.wikipedia.org/)"
(grab-mac-link 'chrome 'org)
⇒ "[[https://www.wikipedia.org/][Wikipedia]]"
(grab-mac-link 'terminal)
⇒ "/Users/xcy/.emacs.d"
Choose an application according to grab-mac-link-dwim-favourite-app
and link
type according to the current buffer's major mode, i.e., major-mode
. For
example, if you use Chrome a lot, you may want to set this in your init file:
(setq grab-mac-link-dwim-favourite-app 'chrome)
AppleScript code used in this program is borrowed from org-mac-link.el
.