Automate large type for viewing, and small for printing -- Part III.
¯¯¯¯¯¯¯¯ ¯¯¯¯ ¯¯¯¯ ¯¯ ¯¯¯¯¯¯ ¯¯ ¯¯¯¯¯ ¯¯ ¯¯¯¯¯¯ ¯¯¯¯ ¯¯
Change to the subdirectory Win32Pad_Editor which we've created below the directory N:\News_Articles, where N = letter Windows assigns to the flash. (In the Windows file-manager, do a right-click and tap letter «o».) If you haven't any Notepad-like editor set up elsewhere on your flash (except the Win32Pad, which with Garamond configured will not render everything in the batfiles below 100% correctly), simply invoke plain old Notepad for now, which is probably already using some monospace font like Courier New or Lucida Console = what we want. Get to Notepad by START->All Programs -> Accessories, or by WinKey+R and type notepad [ENT]. Click File -> Save As and navigate to the Win32Pad_Editor subdirectory. Click the DN-arrow by «Files of type» and click All Files. Shift+TAB once to (or click) File name and type «Switch_INI_INK_W32P.bat» (no quotes) and TAB twice to SAVE [ENT].
Copy and paste the first batfile into Notepad and save. Click File->New and copy and paste the second batfile into Notepad.
Click File->Save As and (as before) pick All Files and (in File name) type «stfs.bat» (no «») -> [SAVE].
Do File -> Exit or (from keyboard) ALT+F4 to quit from Notepad.
Switch_INI_INK_W32P.bat
@echo off & goto go
::
:: = Win32P for Viewing On-Screen -- and Win32P for Printing Hard-Copy. =
:: ¯¯¯¯¯¯ ¯¯¯ ¯¯¯¯¯¯ ¯¯ ¯¯¯¯¯¯ ¯¯¯ ¯¯¯¯¯¯ ¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯ ¯¯¯
:: How to swap between two INIs -- and use a small type for printing.
::
:: (Win32Pad as viewer, with large type face; yet print in small-face.)
:: ¯¯¯¯¯¯¯¯ ¯¯ ¯¯¯¯¯¯ ¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯ ¯¯¯¯ ¯¯¯ ¯¯¯¯¯ ¯¯ ¯¯¯¯¯ ¯¯¯¯
::
:: Roger A. Jacobson • Solution • 7.April 2008
:: ¯¯¯¯¯¯¯¯
:: = Automate the Swapping of win32pad.ini for an .ink - and vice versa. =
:: ¯¯¯¯¯¯¯¯ ¯¯¯ ¯¯¯¯¯¯¯ ¯¯ ¯¯¯¯¯ ¯¯ ¯¯¯ ¯¯¯ ¯¯ ¯¯¯ ¯¯¯ ¯¯¯¯ ¯¯¯¯¯
:: After initial setup is completed (below), the .bat works like this:
::
:: [¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯]
:: | The batch-file provides win32pad.exe with one .ini for viewing and |
:: | a second for printing. To print: exit from win32pad in viewer-mode; |
:: | run this batfile; reload win32pad; print; exit. Then rerun the bat. |
:: | |
:: | When i.e. you're done with printing - then restore the viewer-mode: |
:: | when namely you next run this bat, the viewer-settings switch back. |
:: | |
:: | The viewing INI is kept in INK when printing: then is swapped back. |
:: | ¯¯¯¯¯¯ ¯¯¯ ¯¯¯¯¯¯¯ |
:: | A for-print INI is kept in INK when viewing: swapped back to print. |
:: | ¯¯¯ ¯¯¯¯ ¯¯¯ ¯¯¯¯¯¯ ¯¯¯¯¯ |
:: [_____________________________________________________________________]
::
::
:: Initial setup: exectute COPY WIN32PAD.INI *.INK (make second copy).
:: ¯¯¯¯¯¯¯ ¯¯¯¯¯
:: The two copies INI and INK are for now 100% the same. The ink copy
:: will become the ini for printing. The original ini is for viewing.
:: ¯¯¯¯¯¯
:: The viewing copy of ini will have larger type; print copy, smaller.
:: ¯¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯¯¯
:: Test-run the present batch file now before putting it into service:
:: ¯¯¯¯ ¯¯¯
:: The messages that appear during the test-run show that ini and ink
:: got swapped. Test-runs are to make sure that the bat-file works as
:: intended and that no typing or copy-and-paste errors have crept in.
::
:: Test it as many times as you want: ini and ink are still identical.
:: ¯¯¯ ¯¯¯ ¯¯¯ ¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯
::
:: Now let Win32Pad load up some file you enjoy viewing in large type;
:: Set the font size downwards to print - and set font color to black.
:: ¯¯¯¯¯
:: You are now able to print out your text - with a smaller type face.
::
:: When you do save the print-settings, Win32Pad records them to .ini.
:: The print settings you've just now saved will wind up in INK since
:: when we are done printing one or more Win32Pad files, we rerun bat.
:: ¯¯¯¯ ¯¯ ¯¯¯ ¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯ ¯¯ ¯¯¯¯ ¯¯¯¯¯¯¯¯ ¯¯¯¯¯ ¯¯ ¯¯¯¯¯ ¯¯¯
:: Please quit now from Win32P whose INI is temporarily used to print.
:: Running bat again restores the viewing INI and stores print in INK.
::
:: If running this .bat conveniently with FreeCommander or equivalent:
:: Scroll within the file manager to where current .bat-file is found:
:: It is meant to reside in the same folder as win32pad.ini and -.ink:
:: in i.e. the folder where the corresponding win32pad.exe is located.
:: ¯¯¯¯¯¯¯¯ ¯¯¯
:: Press ENT to run the batfile and to switch extensions ini with ink.
:: They are the same except FontSize=360 (ini) and FontSize=280 (ink);
:: and FontColor=0 (in the ink) -- which is good (black) for printing.
:: Garamond works well - its notion of single-spaced lines is elegant.
:: When you are done with printing -- switch again by re-running .bat.
::
:: I like the print INI configured to «Exit on <Esc>», but not viewer.
:: ¯¯¯¯¯ ¯¯¯¯ ¯¯ ¯¯¯
:: It is a handy workaround for those times when you do wish to print,
:: yet you otherwise enjoy an oversize type-face for viewing the text.
:: ¯¯¯¯¯¯
:go
::
if not exist win32pad.ini goto end
if not exist win32pad.ink goto end
if not exist win32pad.exe goto end
::
:: These three IFs make sure this bat-file runs from the right folder.
::
ren win32pad.ink *.ikk > nul
ren win32pad.ini *.ink > nul
ren win32pad.ikk *.ini > nul
::
echo. & echo win32pad.ini is now become an .ink --
echo. & echo win32pad.ink is now become an .ini --
echo.
find /c /i "Fontsize=360" win32pad.ini > nul
:: ^
:: Replace the «360» ^ with the number from your .ini for larger type:
:: otherwise, you will think that test-runs ¯¯¯¯ ¯¯¯¯¯¯ ¯¯¯¯
:: of this .bat file have changed something in your original ini-file.
::
set findsize=%errorlevel%
if %findsize%==0 goto large
echo Type face is set small for printing.
echo --------
goto pauser
::
:large
echo Type face is set large: for viewing.
echo -------
::
:pauser
echo. & echo.
echo. & echo Tap spacebar when ready to conclude. & echo. & echo.
pause > nul
:: « > nul » blanks pause's standard message.
:: ¯¯¯¯¯ ¯¯¯¯¯
set findsize=
:end
exit
stfs.bat
@echo off & cls
::
::
:: Run the Switch_INI_INK bat-file from any folder.
:: ¯¯¯ ¯¯¯ ¯¯¯¯¯¯ ¯¯¯ ¯¯¯ ¯¯¯ ¯¯¯¯ ¯¯¯¯ ¯¯¯ ¯¯¯¯¯¯
:: Roger A. Jacobson 7. April 2008
::
::
:: This batch file stfs.bat «Switch Type Font Size»
:: ¯¯¯¯ ¯¯¯ ¯ ¯ ¯ ¯
:: runs Switch_INI_INK_W32P at any folder of drive.
::
:: which would otherwise require Switch be in PATH.
:: ¯¯¯¯
:: stfs must reside in the folder where you run it,
:: ¯¯¯¯ ¯¯
:: and: stfs and Switch_INI_INK_W32P on same drive.
:: ¯¯¯¯¯
:: Make plural copies (1/folder) of stfs as wanted.
:: ¯¯¯¯
:: Actual commands begin at line 1 and resume here.
::
cd\
::
:: Change to the root directory of the flash-drive.
::
if exist %cd%News_Articles\Win32Pad_Editor\Switch_INI_INK_W32P.bat goto go
::
goto end
::
:: Check for existence of «Switch_INI_INK_W32P.bat»
:: in the folder N:\News_Articles\Win32Pad_Editor\,
:: where N is the letter Win assigns to your flash.
:: If it doesn't exist where expected, quit batjob.
::
:: If you name the «Switch_INI» batfile by another
:: name, or if you locate that batfile (along with
:: win32pad.exe and the INI and INK) elsewhere you
:: will want to modify the present stfs.bat to fit.
:: ¯¯¯¯ ¯¯¯
:go
::
cd News_Articles\Win32Pad_Editor\
::
:: Change to the directory where the Switch bat is.
::
Switch_INI_INK_W32P.bat
::
:: Run the batfile named «Switch_INI_INK_W32P.bat».
::
:end
exit
The first .bat always stays in the sub-folder.
The second, shorter batch file can be copied to anywhere (including to the «parent» folder [«parent directory»] News_Articles where .nws files reside.)
- - - - - - - - - - - - - - - - - - - - -
«Es stimmt nicht, daß die Kühe Milch geben --
Die Bauern nehmen sie ihnen einfach weg.»
(Radio Holiday)
- - - - - - - - - - - - - - - - - - - - -
Submitted by © Roger A. Jacobson 2008. All rights reserved. Alle Rechte
vorbehalten der Übersetzung einschließlich. This document may be freely
distributed without alteration of its contents, ——— in keeping with the
license agreement of Win32Pad. Reviewers may quote freely citing source.