Advertisement
goatbar

org screen capture for Mac OSX

Sep 23rd, 2011
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.76 KB | None | 0 0
  1. (defun my-org-screenshot ()
  2.   "Take a screenshot into a time stamped unique-named file in the
  3. same directory as the org-buffer and insert a link to this file."
  4.   (interactive)
  5.   (setq filename
  6.         (concat
  7.          (make-temp-name
  8.           (concat (buffer-file-name)
  9.                   "_"
  10.                   (format-time-string "%Y%m%d_%H%M%S_")) ) ".png"))
  11.   ; was import, which should be from imagemagick or graphicsmagick
  12.   ; import only can do X11 windows
  13.   ;(call-process "import" nil nil nil filename)
  14.   ;(call-process "/sw/bin/import" nil nil nil filename)
  15.  
  16.   ; This is the mac version
  17.   ; screencapture -T 5 foo.png
  18.   (call-process "screencapture" nil nil nil "-T" "5" filename)
  19.   (insert (concat "[[" filename "]]"))
  20.   ;(org-display-inline-images)
  21. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement