Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xuchunyang/grab-mac-link.el
Grab link from Mac Apps and insert it into Emacs
https://github.com/xuchunyang/grab-mac-link.el
emacs-lisp macos
Last synced: 3 months ago
JSON representation
Grab link from Mac Apps and insert it into Emacs
- Host: GitHub
- URL: https://github.com/xuchunyang/grab-mac-link.el
- Owner: xuchunyang
- Created: 2016-06-11T09:03:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T16:09:11.000Z (over 3 years ago)
- Last Synced: 2023-08-03T12:44:29.056Z (over 1 year ago)
- Topics: emacs-lisp, macos
- Language: Emacs Lisp
- Homepage:
- Size: 23.4 KB
- Stars: 24
- Watchers: 3
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `grab-mac-link.el`
[![MELPA](https://melpa.org/packages/grab-mac-link-badge.svg)](https://melpa.org/#/grab-mac-link)
[![MELPA Stable](https://stable.melpa.org/packages/grab-mac-link-badge.svg)](https://stable.melpa.org/#/grab-mac-link)Grab link from Mac Apps.
## Supported Apps
- Chrome
- Safari
- Firefox
- Finder
- Terminal
- [Skim](http://skim-app.sourceforge.net/)
- qutebrowser## Supported Link types
Plain: https://www.wikipedia.org/
Markdown: [Wikipedia](https://www.wikipedia.org/)
Org: [[https://www.wikipedia.org/][Wikipedia]]
HTML: Wikipedia## Usage
### `M-x grab-mac-link`
Prompt for an application to grab a link from and prompt for a link
type to insert as, then insert it at point.### `(grab-mac-link app &optional link-type)`
Grab link from App and return it in LINK-TYPE.
``` emacs-lisp
(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"
```### `M-x grab-mac-link-dwim`
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:``` emacs-lisp
(setq grab-mac-link-dwim-favourite-app 'chrome)
```## Acknowledgment
AppleScript code used in this program is borrowed from [`org-mac-link.el`](http://orgmode.org/worg/org-contrib/org-mac-link.html).