SHARE
TWEET

org screen capture for Mac OSX

goatbar Sep 23rd, 2011 197 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top