automatic-screenshot-insertion-in-org

Original idea from http://emacsworld.blogspot.com/2011/05/automatic-screenshot-insertion-in-org.html

Original script using imagemagick:

Using 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."
  (interactive)
  (setq filename
        (concat
         (make-temp-name
          (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 "]]"))
  (org-display-inline-images))