Lisp HUG Maillist Archive

Re: How to show a file in Finder in LW?

Posting this to the list, too:

Pekka

--

Thanks, got it running!

This looks like the most compatible solution:

(defun reveal-in-finder (pathname)
    (sys::call-system (concatenate 'string "/usr/bin/open " "'" 
(directory-namestring pathname) "'")))

It opens up the directory of the file in Finder.

I found this documentation. It is very helpful for developers, since 
shows the flags available for different OS X versions.

http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/open.1.html

For example -R flag works from the 10.6.6 and up. "open 
<directory-pathname>" works in all platforms. Concatenate adds quotes 
and allow spaces in pathname.

Pekka

>On Wed, Aug 3, 2011 at 13:49, Pekka Tolonen <pekka.tolonen@welho.com> wrote:
>>  LW probably does not have the function, but does anybody know if there is OS
>>  X unix command that would do the work?
>
>/usr/bin/open -R /path/to/file
>
>Also have a look at NSWorkspace, specifically
>-selectFile:inFileViewerRootedAtPath: and
>-activateFileViewerSelectingURLs:
>
>HTH,
>Martin


Updated at: 2020-12-10 08:37 UTC