<<< Date Index >>>     <<< Thread Index >>>

Re: Open html email in Safari



On 2004-11-07, Nik Engel <mutt-users@xxxxxxx> wrote:
> : X-Operating-System: Darwin 7.5.0 Power Macintosh: 
> User-Agent: Mutt/1.5.6i
> 
> * David Champion <dgc@xxxxxxxxxxxx> 2004-11-01  (11:53:02am):
> 
> > You'll need a suitable ~/.mailcap entry. I haven't tried this, but I
> > suspect you can work out a solution along these lines:
> Thanks a lot, seems to work nicely Safari opens up with the file but it
> is a empty html file, so the display remains white. Any ideas? 

I think the problem with this particular script,

    #!/bin/sh
    ln "$1" "$1.copy.html"          # retain the html file; mutt removes it on 
rtn
    ( open -a Safari "$1.copy.html";   # message Safari to open this file
      sleep 30;                        # wait for Safari to get things together
      rm -f "$1.copy.html";            # remove the copy; mutt will remove 
original
    ) &                             # all in the background, so mutt regains 
ctl.

is that the file that Safari is to open is a link to the temporary
file that mutt has created, and mutt overwrites that file with 0's
before deleting it, which it does as soon as the the open command is
put in the background and the script returns.  Consequently, by the
time Safari actually reads the file, it contains only 0's.  A little
more detail on this problem and some solutions are given here:

    http://www.spocom.com/users/gjohnson/mutt/#background

HTH,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA