On Thu, Sep 15, 2011 at 10:58:08PM +1000, Cameron Simpson wrote:
> | I have a related problem since moving from XP to Mac last May.  I save email
> | threads as MBOX files and reference them on the (local) home page of my
> | browser, Firefox.  The home page is my to-do list, and it contains 
> references
> | along the lines of:
> | 
> |     <A HREF=file:///Users/tbaker/work/important-email-exchange.mbox>
> | 
> | Under XP, with some fiddling, I was able configure Firefox to launch a 
> batch file,
> | which launched a script, which launched "mutt -f 
> important-email-exchange.mbox".
> 
> Can you explain what you had to tell _firefox_ to achieve this?

Under Windows XP, I had to associate the MBOX file format with
a batch file (.BAT), so that it would run the batch file whenever
I clicked on a reference to an MBOX file.

Many years ago, I could add a MIME Type by hand into an RDF configuration file
for Firefox.  In subsequent versions it became more difficult to add MIME types.
In the end, if I recall, I could add a MIME Type by clicking on a reference with
an unknown extension (.mbox) and filling in the "open with" details.

> I'd imagine you need to associate .mbox file extensions with your
> script, and firefox's Prefs screens don't seem to offer me much control
> there. With a real web server instead of local file access one could
> tell the web server to offer the mbox file as a particular MIME type and
> go from there, but...
> 
> | In
> | other words, one mouse click in my to-do list in Firefox put me right into 
> mutt, 
> | where I could read and directly respond to an email thread.  I have been 
> doing this
> | for years.
> 
> Would the Finder do? Could you have the mboxen in a folder somewhere an
> open then from there? Bypassing Firefox.

If I were able to do that in Finder -- open an mbox file by clicking on it --
then I should think I'd be able to call the same program or script from 
Firefox, 
but I haven't been able to do either one.

I can already by-pass Firefox by opening the file in the Terminal with "mutt
-f".  For me, opening the mboxen in Firefox is important because they are
embedded in my TODO list, which is my Firefox home page.  I am continually
editing my todo list and updating the Web page using a script I wrote in
eighteen years ago (see lifehacker.com article http://tinyurl.com/y4upo4),
recently rewritten in Python for speed and portability (see
http://code.google.com/p/shawkle/).

> You can easily associate an app with a file extension; mine seems set up
> to hand mbox files to the Apple mail client at present. I can change
> that, but then the trick is to have an "app" that takes that and opens
> mutt in a Terminal window.

Right - I figured this should be possible.  Would one do that with 
Automator or Applescript?  I tried the former, with no success, and am
reluctant to get further into the latter without knowing that this 
approach could in principle work.

> | 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.
> 
> Indeed.
> 
> There's a little shell script around called "appify" that wraps a shell
> script in the Mac app stuff for this, but I haven't got it working
> yet... Visit here:
> 
>   http://sixohthree.com/1314/shell-scripts-as-applications-in-mac-os-x
>   http://git.abackstrom.com/appify.git
> 
> Anyway, given that a open a Terminal and run mutt is very easy - some
> AppleScript via the oascript command to open Terminal, a shell script to
> fill in the strings.
> 
> Personally I have a script called "+" that essentially runs:
> 
>   mutt -f "+$1"
> 
> (with a lot of preamble guff). So I real my main inbox just by running
> this command:
> 
>   +

Very cool - thanks for the tip!

> and my "mutt and other mail things" folder thus:
> 
>   + mutt
> 
> Do you not keep open terminals around? Is this easy enough?

I always have alot of open terminals, but when I see a link in my 
browser, I have to copy-and-paste the reference to my mutt -f 
terminal command.  Doable, but it really slows me down when I'm 
working through email threads...

Thank you very much for the "applify" links.  Will let you know if 
I'm able to get this to work...!

Tom

-- 
Tom Baker <[email protected]>

Reply via email to