On Sun, Nov 28, 2010 at 08:35:23PM +0100, David Maus wrote: > At Thu, 18 Nov 2010 18:16:22 +0100, > Jonathan BISSON wrote: > > > > Here is a little function that allows a user to insert a screenshot > > easily. Only works on unix-like systems where ImageMagick is installed > > (adapt "import" to your screenshot program if needed). > > > > Nice. Do you mind of I put the function on Org mode'S wiki (Worg) in > the "Org hacks" page?[1] > > Best, > -- David > > [1] http://orgmode.org/worg/org-hacks.php > -- > OpenPGP... 0x99ADB83B5A4478E6 > Jabber.... dmj...@jabber.org > Email..... dm...@ictsoc.de
I made a minor change. File names are now generated by using the current org buffer filename, plus the date and time, and a unique number. This allows me to sort out the images better. (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 "import" nil nil nil filename) (insert (concat "[[" filename "]]")) (org-display-inline-images)) ------------------------------------------------------------------ Russell Adams rlad...@adamsinfoserv.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3