Re: MS Office file associations



Thanks!  I must have gotten the order wrong the first time.

I commented out the first part:

# regex/i/\.(do[ct]|wri|docx)$
#    Open=/usr/lib/mc/ext.d/doc.sh open msdoc
#    View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view msdoc

Then I added

shell/i/.doc
   View=%view{ascii} /usr/bin/catdoc %f

shell/i/.docx
   View=%view{ascii} /usr/bin/docx2txt %f -

BEFORE

type/^Microsoft\ Word
   Open=/usr/lib/mc/ext.d/doc.sh open msdoc
   View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view msdoc

and it works now.  However, I can't *open* the files if I want to edit them with
LibreOffice.  So I had to add the Open= lines back in:

shell/i/.doc
   Open=/usr/lib/mc/ext.d/doc.sh open ooffice
   View=%view{ascii} /usr/bin/catdoc %f

shell/i/.docx
   Open=/usr/lib/mc/ext.d/doc.sh open ooffice
   View=%view{ascii} /usr/bin/docx2txt %f -

Thanks!
Greg

-------------------------------------------------------------------------------
On Sat 30 Apr 2022 at 10:34 Frank Dietrich wrote:

Hi Greg,

your syntax looks ok. As the extension file is processed top down and
the first matching rule wins. What file type does following command
report for one of your old *.doc files?

file one-of-your.doc

The rule

   shell/.doc
      View=%view{ascii} /usr/bin/catdoc %f

should be placed above the rule

   type/^Microsoft\ Word

or move on top of the rules in file (~/.config/mc/mc.ext)

cheers
Frank
--


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]