From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell Adams Subject: Re: [Orgmode] Automatic screenshot insertion Date: Tue, 29 Mar 2011 09:43:27 -0500 Message-ID: <20110329144327.GE2902@x201> References: <4CE55F66.80802@gmail.com> <87vd3hmebo.wl%dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=50555 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4a8v-0002ZI-Bg for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 10:43:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4a8s-0004FH-E7 for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 10:43:35 -0400 Received: from jack.asmallorange.com ([74.52.119.82]:37270) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4a8s-0004F6-9B for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 10:43:34 -0400 Received: from m3f2436d0.tmodns.net ([208.54.36.63] helo=localhost) by jack.asmallorange.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1Q4a8n-0007iK-1E for emacs-orgmode@gnu.org; Tue, 29 Mar 2011 09:43:29 -0500 Content-Disposition: inline In-Reply-To: <87vd3hmebo.wl%dmaus@ictsoc.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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.... dmjena@jabber.org > Email..... dmaus@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 RLAdams@AdamsInfoServ.com PGP Key ID: 0x1160DCB3 http://www.adamsinfoserv.com/ Fingerprint: 1723 D8CA 4280 1EC9 557F 66E8 1154 E018 1160 DCB3