How to use output of mwawFileOSX?

Help
2012-11-03
2013-12-07
  • David Schmidt
    David Schmidt
    2012-11-03

    Hello -

    Thanks for making this available. I'm hopeful I can make great use of it.

    I have run mwawFileOSX, and have my list of files. How do I feed HERE_is_mwawFile_Result.txt to mwawOSX to actually translate this list of files into .odt format?

     
  • alonso laurent
    alonso laurent
    2012-11-04

    Hello David,
    mwawOSX can already convert a bunch of files(1) and will only create a resulting .dot
    file if it can convert a file. I create mwawFile so that people can find the format
    of some forgotten files ( and help them to search for an application which can convert
    them ) ; in fact, mwawFile can recognize more formats(2) than mwawOSX can
    convert, you can take a look at the file src/lib/tools/file/file.cpp which is in the
    Libmwaw git repository.

    So just some little ideas

    1) To launch mwawOSX recursively on a folder, the best method is probably to
    modify it, it is an AppleScript which can be edited with AppleScript Editor
    ( in /Applications/Utilities/ ) ; I suspect that others can write more efficient and
    more beautiful AppleScripts than me, so if someone want to help :-) ; if not,
    I will try to see if I can do that :-~

    2) It is also possible to use the Terminal and to write something like that :

    grep :MacWrite HERE_is_mwawFile_Result.txt |sed -e"s/\(.*\):MacWrite.*/ls \"\1\"/" > /tmp/command.sh

    sh /tmp/command.sh

    which looks for the MacWrite, MacWrite II, MacWrite Pro files, and for each such file
    launches the command ls. After, it is possible to replace ls by myProgram which can
    for instance, choose the name of the conversion file and call mwaw2odt
    (in mwawOSX/bin ) to do the conversion...

    3) Finally, we can also add more output options to mwawFile ; ie. in the main function
    of file.cpp, if someone has some idea...

    Hope that this helps a little,
    osnola.

    (1) you can select a list of files in the Finder and drag them in the mwawOSX icon.
    (2) I will try to add more formats, if I find some free time...

     
    Last edit: alonso laurent 2012-11-04

    • Anonymous
      2013-12-06

      I don't know whether you are still active with this site. I am trying to convert old cwk files that I have listed in a libreoffice spreadsheet. All the files are either text or spreadsheet files. None are of the other types like draw, presentation, database etc.
      I have a libreoffice basic routine that loops through all the file names. I am a PC guy but this will be running on a Mac. As a PC guy I know little about applescript. My plan is to open each of the files as a cwk file in libreoffice. Once open I want to save it as an .odt file. If the cwk file is a text file it will save it correctly to the same location. If it is a spreadsheet file it will generate an error. I want to trap the error and simply close the cwk file and note in my spreadsheet that it is spreadsheet type. Could I call your convert routine supplying the file name with full path and have it either convert or simply close and return an indication of which. Any help or suggestions would be most appreciated.

       


Anonymous


Cancel   Add attachments