Monday, May 2, 2011

Automatic Screenshot insertion in Org Mode

Trawling the org-mode mailing list , found another interesting hack on getting screenshots into your org notes.  The thread on what was originally asked is here, where the OP wanted to go from the clipboard into a named file.  One of the org members posted this reply along with the link to the elisp code.

Works on Unix-like systems with Imagemagick installed.


Carlo Bertini said...

original idea from Russell Adams (

use scrot

(defun org-screenshot ()
"Take a screenshot into a time stamped unique-named file in the same directory as the org-buffer and insert a link to this file."
(setq filename
(concat (buffer-file-name)
(format-time-string "%Y%m%d_%H%M%S_")) ) ".png"))
(call-process "scrot" nil nil nil "-s" filename)
(insert (concat "[[" filename "]]"))

Rajarshi Tiwari said...

Nice idea! Thanks for posting :-)

- Rajarshi

Jagadeesh N. Malakannavar said...

nice idea. thanks much for sharing