Created
August 8, 2015 12:39
-
-
Save xcodebuild/5f1f17fee8c11b4f3348 to your computer and use it in GitHub Desktop.
Take a screenshot and insert in emacs(Mac only)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my-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 | |
"art/" | |
(buffer-name) | |
"_" | |
(format-time-string "%Y%m%d_%H%M%S_")) ) ".png")) | |
(call-process-shell-command "screencapture" nil nil nil "-s -t png" filename) | |
(insert (concat "[[file:" filename "]]")) | |
(org-redisplay-inline-images) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment