Guest User

Untitled

a guest
May 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. ;; -*- mode: emacs-lisp; coding: utf-8 -*-
  2.  
  3. ;; set applescript to open and run Spde sketch
  4. (defvar apple-script-file
  5. "~/.emacs.d/etc/openAndRunSketch.applescript")
  6.  
  7. ;; set application name of Spde
  8. (defvar application-name "Spde")
  9.  
  10. ;; run applescript
  11. (defun run-apple-script ()
  12. (shell-command-to-string
  13. (format "osascript %s %s %s"
  14. apple-script-file
  15. application-name
  16. buffer-file-name)))
  17.  
  18. (add-hook
  19. 'after-save-hook
  20. '(lambda ()
  21. (cond ((string-match "\.pde$" buffer-file-name)
  22. (run-apple-script)))))
  23.  
  24. ;; EOF
Add Comment
Please, Sign In to add comment