M-x reveal-in-osx-finderis invoked in a file-associated buffer, it will open the folder enclosing the file in the OS X Finder. It will also highlight the file the buffer is associated with within the folder.
M-x reveal-in-osx-finderis invoked in a dired buffer, it will open the current folder in the OS X Finder. It will also highlight the file at point if available.
M-x reveal-in-osx-finderis invoked in a buffer not associated with a file, it will open the folder defined in the default-directory variable.
This package depends on
dired.el, which should be available in the default emacs installation. It only works on the OS X environment on Macs.
It is available on the MELPA repository. Do the following, then choose and install reveal-in-osx-finder.
To configure the MELPA, see this: http://melpa.milkbox.net/#/getting-started
Then, put the following in your emacs configuration file.
;; To load at the start up (require 'reveal-in-osx-finder) ;; If you want to configure a keybinding (e.g., C-c z), add the following (global-set-key (kbd "C-c z") 'reveal-in-osx-finder)
This is a modified version of the
open-finder found at the URL below. Thank you elemakil and lawlist for introducing this nice piece of code,
and Peter Salazar for pointing out a useful link about AppleScript (below),
and mikeypostman and purcell for auditing the code for MELPA approval.