From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aankhen Subject: Re: extending automatic screenshot insertion Date: Fri, 26 Aug 2011 12:59:01 +0530 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwqqz-0006d7-Is for emacs-orgmode@gnu.org; Fri, 26 Aug 2011 03:29:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qwqqx-0006LM-6W for emacs-orgmode@gnu.org; Fri, 26 Aug 2011 03:29:25 -0400 Received: from mail-yw0-f41.google.com ([209.85.213.41]:48188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwqqx-0006LF-1i for emacs-orgmode@gnu.org; Fri, 26 Aug 2011 03:29:23 -0400 Received: by ywm13 with SMTP id 13so2734527ywm.0 for ; Fri, 26 Aug 2011 00:29:21 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Aditya Mandayam , Org mailing list Hi, On Thu, Aug 25, 2011 at 15:41, Aditya Mandayam wrote: > i would like to extend the auto screenshot method described here: > http://comments.gmane.org/gmane.emacs.orgmode/33770 > > first: a way in which i can be prompted to enter a filename instead of > having a random string > second: a timestamp be appended after i have entered the filename > third: to specify somehow, the dimensions of the bounding box of the scre= enshot > > how can this be done? Starting from the revised version of the function,[1] here=E2=80=99s how I= =E2=80=99d implement the first two changes: ,---- | (defun org-screenshot () | "Prompt for a filename, add a timestamp, take a screenshot into that file and insert a link to this file." | (interactive) | (setq filename | (concat (read-string "Save screenshot as (timestamp and extension will be appended): " (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)) `---- I don=E2=80=99t have the =E2=80=98import=E2=80=99 utility so I can=E2=80=99= t help there. It can probably take arguments to denote the bounding box; have a look at the documentation for both =E2=80=98import=E2=80=99 and =E2=80=98call-process= =E2=80=99. Aankhen [1]: http://permalink.gmane.org/gmane.emacs.orgmode/40271