emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] extending automatic screenshot insertion


From: Aankhen
Subject: Re: [O] extending automatic screenshot insertion
Date: Fri, 26 Aug 2011 12:59:01 +0530

Hi,

On Thu, Aug 25, 2011 at 15:41, Aditya Mandayam <address@hidden> 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 
> screenshot
>
> how can this be done?

Starting from the revised version of the function,[1] here’s how I’d
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’t have the ‘import’ utility so I can’t help there.  It can
probably take arguments to denote the bounding box; have a look at the
documentation for both ‘import’ and ‘call-process’.

Aankhen

[1]: http://permalink.gmane.org/gmane.emacs.orgmode/40271



reply via email to

[Prev in Thread] Current Thread [Next in Thread]