home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Freeware 31 / FreelogHS31.iso / Texte / scribus / scribus-1.3.3.9-win32-install.exe / libs / tools / antiword / Docs / Mozilla < prev    next >
Internet Message Format  |  2002-11-16  |  2KB

  1. Date: Mon, 11 Nov 2002 11:36:21 +0000
  2. From: Cam <camilo@mesias.co.uk>
  3. Subject: Re: antiword
  4.  
  5. Hi
  6.  
  7. I have updated the script for the latest Mozilla with plugger, as found 
  8. in RedHat 8. This makes the default action a very quick text view of a 
  9. document, much better IMHO than starting ooffice or abiword. If users 
  10. want to edit the file they can still save as.
  11.  
  12. Here is a slightly improved script for gnome users:
  13.  
  14. #!/bin/bash
  15.  
  16. tmpfile=/tmp/aw$$.txt
  17.  
  18. lastditch=`which vi`
  19.  
  20. editor=${EDITOR:-$lastditch}
  21.  
  22. if [ ! -x $editor ] ; then
  23.    editor=$lastditch
  24. fi
  25.  
  26.  
  27. tmpfile=/tmp/aw$$.txt
  28.  
  29. gtopts="-t antiword-helper --hide-menubar"
  30.  
  31. antiword "$1" > $tmpfile
  32. chmod -w $tmpfile
  33. gnome-terminal $gtopts -x $editor $tmpfile ; chmod +w $tmpfile ; rm $tmpfile
  34.  
  35.  
  36.  
  37. Here is the script for non-gnome users:
  38.  
  39. #!/bin/bash
  40.  
  41. tmpfile=/tmp/aw$$.txt
  42.  
  43. lastditch=`which vi`
  44.  
  45. editor=${EDITOR:-$lastditch}
  46.  
  47. if [ ! -x $editor ] ; then
  48.    editor=$lastditch
  49. fi
  50.  
  51.  
  52. antiword "$1" > $tmpfile
  53. chmod -w $tmpfile
  54. xterm -T "antiword-helper" -e $editor $tmpfile
  55. chmod +w $tmpfile
  56. rm $tmpfile
  57.  
  58.  
  59.  
  60. To use the scripts add an entry into your plugger config file 
  61. (pluggerrc, for locations check man plugger). Mine is in 
  62. /home/cxm/.netscape/pluggerrc:
  63.  
  64. The line to add is (it has a leading tab):
  65.  
  66.    ignore_errors exits: antiword-helper "$file"
  67.  
  68.  
  69. Here is my config file after I added the line
  70.  
  71. application/rtf: rtf: Rich Text Format
  72. application/x-msword: doc, dot: Microsoft Word Document
  73. application/msword: doc, dot: Microsoft Word Document
  74.          ignore_errors exits: antiword-helper "$file"
  75.          nokill exits: oowriter "$file"
  76.          repeat swallow(AbiWord) fill: AbiWord -nosplash -geometry 
  77. +9000+9000 "$file" >/dev/null 2>/dev/null
  78.          repeat swallow(PCFileViewer) fill: sdtpcv "$file"
  79.          repeat swallow(PCFileViewer) fill: /opt/SUNWdtpcv/bin/sdtpcv 
  80. "$file"
  81.  
  82.  
  83. Then start Mozilla / Netscape and you should be able to quickly view 
  84. word docs from the browser and as email attachments.
  85.  
  86. Hope that helps,
  87.  
  88. -Cam
  89.