This is very close ... I think. The problem is that the file name needs to be formatted for Windows. Currently its formatted using unix style forward slashes. The file name that is passed to irfan in the call process needs to be formatted with Windows style backslashes. Without this fix, irfan will complain that it doesn't recognize the file type. In other languages I could figure out how to do the replace sequence, but it would take me awhile in lisp. Is there a quick fix?
Thanks! Mark --- On Wed, 5/4/11, Russell Adams <rlad...@adamsinfoserv.com> wrote: > From: Russell Adams <rlad...@adamsinfoserv.com> > Subject: Re: [O] insert picture feature request. > To: "Rainer Stengele" <rainer.steng...@diplan.de> > Date: Wednesday, May 4, 2011, 6:19 AM > On Wed, May 04, 2011 at 12:01:53PM > +0200, Rainer Stengele wrote: > > > i_view32.exe /capture=2 > /convert=c:\capture_$U(%d%m%Y_%H%M%S).jpg > > (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 "i_view32.exe" nil nil nil > > "/capture=2" (concat "/convert=" filename) ) > (insert (concat "[[" filename "]]")) > (org-display-inline-images)) > > Does that work? Elisp is formatting the filename based on > the Org > buffer you're in and adding a timestamp. > > ------------------------------------------------------------------ > Russell Adams > rlad...@adamsinfoserv.com > > PGP Key ID: 0x1160DCB3 > http://www.adamsinfoserv.com/ > > Fingerprint: 1723 D8CA 4280 1EC9 557F > 66E8 1154 E018 1160 DCB3 > >