Wow - this is great.  Thanks! Options to work with :-)

I installed iTerm, configured it for "/sw/bin/mutt -f $$URL$$" and tried
clicking on:

    <A HREF=wais://Users/tbaker/mbox>mbox - 2 slashes</A>
    <A HREF=wais:///Users/tbaker/mbox>mbox - 3 slashes</A>

Firefox prompted me to choose a program, with iTerm as default,
and when I chose it, Firefox launched an iTerm window, but nothing
appeared in the window.

I see this is going to take some more study, e.g., of apple script...
Will report back if successful, but it may take a week or two before 
I can find the time.

Many thanks,
Tom

On Tue, Sep 13, 2011 at 11:01:39AM -0400, Tim Gray wrote:
> On Sep 13, 2011 at 10:06 AM -0400, Tom Baker wrote:
> >If I could solve this problem, then presumably I could configure the Mac to
> >open mutt when I click on a file such as "important-email-exchange.mbox" in
> >the Mac Finder.
> >
> >I have tried everything I could think of, even looked into Emacs's Rmail, but
> >I'm not sure I understand the system well enough to know where to look for 
> >the
> >answer.  Would one need to write an Apple script?  Can anyone suggest an
> >approach?
> 
> There is probably some way to do with with apple script and/or
> iTerm.
> 
> I'm sure you could do it with an applescript and Terminal/iTerm.
> Have the applescript receive the link, either by associating it with
> a custom URL scheme (instead of "file:///path/to/box", maybe try
> "x-mbox:///path/to/box") or by getting the selection as a file path
> or something.  Then parse the input (URL or file path) for the
> mbox's file path.  Then open up a Terminal/iTerm window and run the
> command mutt command with the mbox path as an argument.
> 
> Alternately, you might be able to do it with no applescript if you
> use iTerm, since iTerm can be associated with specific URL schemes,
> like mailto:.  Then in the profile command box, instead of having it
> start a login shell, you can enter a command with a placeholder for
> the URL, like so:
> 
>     /usr/local/bin/mutt $$URL$$
> 
> Thus, when I click on a mailto: link, iTerm handles it and runs mutt
> with the contents of the link.  I think you could modify that
> somehow to run `mutt -f $$URL$$` as long as the URL was a file path.
> Of course, you wouldn't want to pollute the mailto URL scheme, so
> you'd have to pick another one.  Looking at iTerm's preferences
> right now, the allowed choices are: https, ftp, gopher, mailto,
> news, nntp, telnet, wais, whois, x-man-page.  No custom options.
> However, the iTerm developer is pretty responsive and might add in
> the capability to handle custom x-stuff schemes.
> 
> Just some thoughts.  There's probably a better way to do what you
> want...

-- 
Tom Baker <t...@tombaker.org>

Reply via email to