[brailleblaster] Re: BrailleBlaster Update

  • From: "Cearbhall O'Meadhra" <cearbhall.omeadhra@xxxxxxx>
  • To: <brailleblaster@xxxxxxxxxxxxx>
  • Date: Sat, 12 Jul 2014 17:14:34 +0100

Hello team,

MY name is Cearbhall O'Meadhra and I am new to this list. I was delighted to
find brailleblaster and to find it so easy to use. I would like to help
develop the program in any way that I can. I am learning Java so it will be
a while before I can help with that side of the programming but if someone
wants some small tasks carried out I would love to help!

I am working with a community organisation here in Bray, Co. Wicklow, that
has an Index embosser but no funds to buy expensive production software.
Brailleblaster is just perfect for our needs. I have put together a suite of
CMD batch programs to run under Windows that will allow the staff to run
Braillebalster without having to know much about the technology. I would
welcome your comments on my coding. If you would like to recommend
improvements, I would be delighted to take them on board.
For convenience, I have set out the full code of the three separate modules
here. I have also made the zip folder of the three files available at the
following Drop Box link:
https://dl.dropboxusercontent.com/u/5114351/braillerun.zip 
I would like to invite you to download them and save them to any directory
that you wish and run them from there in a command.cmd window. 

The programs should save the directory containing the three braille batch
programs  as the default working directory. It will, by default,  expect the
input and output files to be found and saved in this directory. It will also
find your brailleblaster program in the appropriate programs directory
depending on whether you have a 32 bit or 64 bit OS. It will also give you
the option of changing the working directory without having to break out of
the batch program.

If you wish to start the program inline such as :
Braille myInput file [my output.brf]
The batch program will catch the input and output files if present as
parameters and ask you to confirm them before proceeding. IF you want to let
the program do all the work, you just need to type braille and the command
prompt.

The opening menu will give you four choices and will respond to a single key
press. Press "q" to quit!

Enjoy!
 

Here is the code:
------------------------------------
Module 1 - Braille .bat
@echo off
:: Batch file to manage brailleBlaster conversion routines
:: C. O'Meadhra  26/06/ 2014
:: Revision 1.8 07/06/2014
:: 
:: save the current directory path
set current=%cd%\
call findOS
:title
title brailleBlaster process Assistant
if "%1" == "?" goto query
if "%1" == "/?" goto query

:: Save any input parameters
 if not "%1" == "" set inputFile=%1 & set %1= 
if not "%2" == "" set outputFile=%2 & set %2= 

:start
if errorlevel 24 pause
cls
echo(
echo(
echo *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
*  *  *
echo *
*
echo *     Select an option:
*
echo *     1. Open the braleBlaster program for word processing.
*
echo *     2. Open the brailleBlaster program with a selected input file.
*
echo *     3. Automatically translate input file to nominated output file.
*
echo *     4. Emboss the translated braille version of the input file.
*
echo *
*
echo *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
*  *  *
echo(
echo(

choice /c 1234q /n /m "Select an option or q to exit "
:: For error checking only
:: echo the error level is:
::      ECHO.%ERRORLEVEL%
echo(
echo(
echo(

if Errorlevel 5 goto end
if Errorlevel 4 goto emboss
if Errorlevel 3  goto lineMode
if Errorlevel 2 goto inputFile
if Errorlevel 1 goto wordprocessor
GOTO END

:wordprocessor
java -jar brailleblaster.jar
goto start

:: Option 2
:inputFile
set bMode=inputfile
call %current%filechooser
if errorlevel 24 goto start
:process2
java -jar brailleblaster.jar translate %bPath%%inputFile%  
goto start

:lineMode
call %current%filechooser
if errorlevel 24 goto start
:process3
java -jar brailleblaster.jar translate %bPath%%inputFile%
%bPath%%outputFile%  
goto start

:emboss
set bMode=emboss
call %current%filechooser
if errorlevel 24 goto start
        :process4
java -jar brailleblaster.jar translate %bPath%%inputFile% %embosser% 
goto start

:query
echo   braille.bat calls brailleBlaster to convert print text into Braille. 
echo   BrailleBlaster accepts subcommands and filenames on the command line.

echo Simply type the parameters you want by typing:
echo braille inputfile outputfile on the command line.
echo Type the full file name and extension .txt .doc .htm etc.
echo If you simply type braille without any filename or with only the input
filename, 
echo brailleBlaster will open in interactive mode.
echo The subcommands are:
echo   translate: translate a file into braille. 
echo The simplest usage of this subcommand is:
echo   braille inputfile outputfile
echo   If you wish to emboss the translated output choose option 4.

:end
set inputFile=
set outputFile=
 popd
------------------------------------
Module 2 - Here is the code of pushos.bat  :
:: Batch routine to check which operating system is active
:: c. O'Meadhra  29/06/2014
:CheckOS
IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64BIT) ELSE (GOTO 32BIT)

:64BIT
pushd C:\Program Files (x86)\brailleblaster
GOTO osEnd

:32BIT
pushd C:\Program Files\brailleblaster
:osEnd

------------------------------------
Module 3 - here is the fileChooser.bat:
@echo off
rem Batch routine to select braille input and output files
rem C. O'Meadhra  29/06/2014
:: Revision 1.8 07/06/2014
::
:: bPath not yet set
if "%bPath%" == "" set bPath= %current%
echo The file location is %bPath%
echo Do you wish to use this location? 
choice   
:: echo the error level is %ERRORLEVEL%
:: pause
if errorlevel 2 goto newPath
if errorlevel 1 goto checkInputFile
:newPath
set /p bPath=Enter the new path including drive letter, i.e.:
c:\folder1/folder2/ ... 
if not exist %bPath% echo invalid path & goto newPath
:checkInputFile
if "%inputFile%"== "" goto newInFile 
if not exist %bPath%%inputFile% echo file %inputFile% not found & goto
newInFile
echo Do you wish to use %inputFile% as the input file?"
choice   
:: echo the error level is %ERRORLEVEL%
:: pause
if errorlevel 2 goto newInFile
if errorlevel 1 goto checkOutFile
:newInFile
set /p inputFile=Enter the input file(without file path).
if "%inputFile%" == "" echo quitting input file selection process & exit /b
24
if not exist %bPath%%inputFile% echo file %inputFile% not found & goto
newInFile
:checkOutFile
if "%bMode%"== "inputfile" goto fEnd
if "%bMode%"== "emboss" goto fEnd
if "%outputFile%"== "" goto newoutfile 
echo Do you wish to use %outputFile% as the output Braille file?"
choice   
:: echo the error level is %ERRORLEVEL%
:: pause
if errorlevel 2 goto newoutfile
if errorlevel 1 goto fEnd
:newoutfile
set /p outputFile=Enter the output file name (without file path). 
if "%outputFile%" == "" echo quitting output file selection process & exit
/b 24

:fEnd
set bMode=nul

------------------------------------

I look forward to receiving your comments!

All the best,

Cearbhall 

M: 0833323487  T: (01) 2864623  em: cearbhall.omeadhra@xxxxxxx





Other related posts: