Org Capture from External Applications

Posted by:

Capture Links/Notes from Web Browsers or Other Applications

Firefox

Solution 1: From official org-capture site [Did NOT work for me]

org-protocol.el – Intercept calls from emacsclient to trigger custom actions Please refer to http://kb.mozillazine.org/Register_protocol and use “org-protocol” as protocol for Firefox. I think the reason for failure lies in the Linux Desktop environments, which is resolved by Solution 2 and 3.

Solution 2: Firefox plugins -the easiest way if you only want it to work with Firefox.

  1. Install the Firefox addon from here; source code link here.
  2. Configure the addon.

    Scr-org-cap-FF-plugin.png

  3. Set up a capture template

  4. Highlight some text in Firefox and your fire shortcut key C-M-r, you should see a Emacs client popup with all the capture info.

    Scr-FF-capture.png

Solution 3: Registering Org-Protocol with XDG-open

This method should work with other browsers (e.g. Chrome) and applications (e.g. Acrobat), and it is a clean way of getting xdg-open (a tool for configuring default applications in Linux) to open org-protocol links and pass them to emacs. adopted and modified from those two links link1 , link2 and Registering Custom URI Handler

  1. Add .desktop file, Create and save a file called org-protocol.desktop to ~/.local/share/applications containing:

  2. Add org-protocol handler – for more about: Registering Custom URI Handler

  3. and run,

    This step makes Firefox aware that “org-protocol” is a valid scheme-handler or protocol (by updating ~/.local/share/applications/mimeinfo.cache), and causes Firefox to prompt for a program to use when opening these kinds of links.

  4. Add config settings to dot-emacs file,

    plus the capture template as in Solution 2/Step3.

  5. Add Firefox bookmarklet with following javascript

    Scr-bookmarklet-ff.png

    Note: 1. Bookmark Toolbar/New bookmark (with right click) to add bookmarklet 2.the w (in the javascript) is the shortcut key for the capture template.

  6. Select some text in a website and click on the Boolmarklet you just created. add the “/usr/bin/emacsclient” program if prompted.
  7. You should see the beautiful popup as in Solution 2 step 4.

Google Chrome or Chromium

Note: only tested Chrome here.

  1. Follow step 1-4 in Solution 3.
  2. Right click Bookmark Toolbar and Add a page to add a Bookmarklet (reference)
  3. Follow step 6 and 7 in Solution 3, you should see popped up Emacs windows with captures.

    Scr-org-capture-chrome.png

For store-link to work in Firefox and Google Chrome

  1. Follow step 1-4 in Solution 3.
  2. Add Bookmarklet for store-link with following javascript.

  3. use C-y to insert store-link in Emacs after invoke it in your Browsers.

Adobe Acrobat Reader (update, finally working with help of RLM)

  1. Adapted from http://article.gmane.org/gmane.emacs.orgmode/6810
  2. Place a javascript file for each menu entry in ~/.adobe/Acrobat/9.0/JavaScripts on unix-like systems. org-store-link.js from http://article.gmane.org/gmane.emacs.orgmode/6810

    org-capture.js from http://article.gmane.org/gmane.emacs.orgmode/6810

    Note: this.page.Num+1 is used get the page number index.

  3. The examples given here will place new menu entries in the “Tools” menu, after restarting Adobe Reader.

    Scr-capture-acrobat.png

  4. check Enable Menu Items JavaScript Execution Privileges under Edit > Preferences > Javascript Otherwise, internal error messages.
  5. Create a capture templates in dot-emacs file

  6. Assign Evince for opening PDF file at captured page

    Note: Acroread is incapable of deciphering its own page indexing system. Evince -i (NOT p) is employed to navigate to the target page correctly.

  7. Capture PDF file link with page index.

    Scr-pdf.png

    Issues: Each triggers two FireFox windows popups (if FF is open) with a error message. Sometimes triggers double capture too. Acrobat sorely lacks of Selection Object, so the selection capture as in Browsers seems not possible, which is minor since a simple copy-and-paste takes care of it.

0

Add a Comment