Giter Site home page Giter Site logo

MC file plugins for win about mcwin32 HOT 5 OPEN

eugenov avatar eugenov commented on May 27, 2024
MC file plugins for win

from mcwin32.

Comments (5)

atravert avatar atravert commented on May 27, 2024 2

Hello,

Finally I found the following solution: in mc.ext the lines Open=... or View=... invoking doc.sh can be replaced by:
Open=cmd /c start openprogram %p
View=cmd /c start viewerprogram %p

where openprogram and viewerprogram are exe programs that can be found in the DOS PATH.

For instance for ms word/excel/powerpoint, one could use:

# Microsoft Word Document
regex/i/\.(do[ct]|wri|docx)$
	Open=cmd /c start winword %p
	View=cmd /c start winword %p
type/^Microsoft\ Word
	Open=cmd /c start winword %p
	View=cmd /c start winword %p


# Microsoft Excel Worksheet
regex/i/\.(xl[sw]|xlsx)$
	Open=cmd /c start excel %p
	View=cmd /c start excel %p
type/^Microsoft\ Excel
	Open=cmd /c start excel %p
	View=cmd /c start excel %p

# Microsoft PowerPoint Presentation
regex/i/\.(pp[ts]|pptx)$
	Open=cmd /c start powerpnt %p
	View=cmd /c start powerpnt %p

Finally, as start "" filename.ext makes WIN opening the file with the default program based on extension, one can put on top of mc.ext:

Open=cmd /c start "" %p

This will directly open the file with the default program.

@adamyg : I made few web search, but I did not find recipes to open/view files with mcwin32 (but maybe I did not use the correct keywords). It could be helpful to do so and/or change the default mc.ext so that files with current extensions could be directly opend/read with RETURN/ F3 keys ?

from mcwin32.

adamyg avatar adamyg commented on May 27, 2024

need an example use-case; scripts can always exec "start file-name" gaining win shell file association features.

from mcwin32.

eugenov avatar eugenov commented on May 27, 2024

I.e. I have some *.pdf file, which opens with MS edge in Explorer. When I execute it in mc (with RETURN key), nothing happens. The same with *.doc, *.xls and other file formats with windows assosiations.
I believe it's hard to implement archive processing inside mc in win, am I right?

from mcwin32.

atravert avatar atravert commented on May 27, 2024

Hello,

Currently the workaround I found to open a file from mc in a external application is to run the following in mc command line:

$ start program %f

  • start is a DOS command -- type help start on a command window for details,
  • program is the name of the executable, with or without its extension. In the case of MS word, for instance, the executable is winword.exe and generally in the PATH, so winword should work.
  • %f is the mc macro for the currently selected file.

So providing a .doc or .docx file is selected in the active panel, the following should work :

$ start winword %f

or equivalently:

$ start winword followed by CTRL + RETURN to add the filename

@eugenov , regarding your initial question: when I just type RETURN on a word file I have the following error (I guess that you should see a similar error, but you must type CRL+o to see the full output of the command line)

image

I don't know much about its implementation, but I suppose that mc is able to execute a part of doc.sh. Here for instance It recognize that type of file is a msdoc, but can't execute wvHtml or elinks which are linux commands.

I agree with you it would be nice being able to directly open the files by typing RETURN. I think that the mc.ext file is meant to do that, but I hanven't figured out yet how to properly do that in windows...

from mcwin32.

adamyg avatar adamyg commented on May 27, 2024

The diagnostics reported is result of the logic within plugin/doc.sh (below); which is assuming a unix / open-office / abiword environment; shall consider reworking

  wvHtml "${MC_EXT_FILENAME}" --targetdir="$tmp" page.html -1
  elinks "$tmp/page.html"

from mcwin32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.