• Re: {rightclick} New | Text Document

    From Wolf Greenblatt@wolf@greenblatt.net to alt.comp.os.windows-10,alt.comp.os.windows-11,alt.msdos.batch on Mon Nov 25 18:04:40 2024
    From Newsgroup: alt.msdos.batch

    On Mon, 25 Nov 2024 22:42:09 +0100, Herbert Kleebauer wrote:

    On 09.11.2024 05:14, Wolf Greenblatt wrote:

    Many of my programs are those you wrote that I found on the archives for
    this newsgroup whenever I search for things - like your spelling program.

    I love that it gives me three chances to spell a word and if I get it
    right, then it removes the word from my misspelled word list.

    Just found out, that it doesn't work properly in Win11, you have to
    insert a small pause before the word is spoken:

    cscript //nologo speak.vbs "<silence msec='700'/> %*"

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: >:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    @echo off
    :: you have to create spell.txt with the words to be spoken
    :: enter x to terminate program

    chcp 65001>nul
    :: win11 Terminal doesn't support mode con
    :: MODE CON: COLS=50 LINES=10
    :: color f0
    cls

    ::echo createobject("sapi.spvoice").speak wsh.arguments(0)>speak.vbs

    :: or with rate/volume specified
    echo Set sapi = createObject("sapi.spvoice") >speak.vbs
    echo sapi.Rate = -3 >>speak.vbs
    ::echo sapi.Volume = 100 >>speak.vbs
    echo sapi.Speak wsh.arguments(0) >>speak.vbs

    for /f "tokens=*" %%i in (spell.txt) do call echo %%random%% %%i>>spellerr.txt
    sort /o spelltmp.txt spellerr.txt
    del spellerr.txt
    set /a ok=0
    set /a not_ok=0

    for /f "tokens=1*" %%i in (spelltmp.txt) do call :sub %%j
    :end
    del speak.vbs
    del spelltmp.txt
    echo.
    echo %ok% W%rter richtig, %not_ok% W%rter falsch
    echo.
    pause
    exit

    :sub
    echo.
    set /a n=0
    :sub1
    set /a n=n+1
    if %n%==3 goto :sub2
    :: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ms717077(v=vs.85)
    cscript //nologo speak.vbs "<silence msec='700'/> %*"
    set a=
    set /p a=
    if /i "%a%"=="x" goto :end
    if /i not "%*"=="%a%" goto :sub1
    set /a ok=ok+1
    goto :eof

    :sub2
    echo 0 %*>>spellerr.txt
    echo ---------- %*
    set /a not_ok=not_ok+1
    timeout /t 2 >nul

    Thanks for that update. I'm on Windows 10 so I wasn't aware of this change. I'll fix mine so that when I move to Windows 11, it will still work.
    The way I run it is I have an app paths key called "spell".

    So I bring up the Runbox and then I type "spell" to add a squiggled word.
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
    spell.exe = C:\path-to\spelltxt.txt

    Then when I have time, type "bee" to test my personal spelling errors.
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
    bee.exe = C:\path-to\spellingbee.bat

    @echo off
    REM spellingbee.bat for Windows 10, originally by Herbert Kleebauer 20220211
    REM A self-test of redsquiggled words with a self-reinforcing misspelled DB.
    REM Newsgroups: alt.comp.os.windows-10,alt.msdos.batch,alt.usage.english
    REM Message-ID: <su5ifp$300$1@gioia.aioe.org>
    REM Customized for only the words that YOU misspell (just yours!)
    REM Randomly speaks thos words giving you a chance to type them correctly.
    REM Strategy being it _must_ be quick & easy; otherwise you won't do it.
    REM Purposefully uses audio instead of a visual to present the word.
    REM Strategically, this uses a visual to reinforce the correct spelling.
    REM Logic being that seeing it _before_ trying to spell it taints memory.
    REM Logic being seeing it _after_ an attempt tends to reinforce memory.
    REM Tactic is auto-honing of just the words _you_ have recently misspelled.
    REM Tactic is repetition specifically for the words _you_ misspelled most.
    REM Recommended one-time setup:
    REM 1. Set up an AppPath for a quick command: "Run > spell"
    REM (Use that command to add redsquiggled words into spelltxt.txt)
    REM HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
    REM spell.exe = C:\data\database\tts\spelltxt.txt
    REM 2. Set up an AppPath for a quick command: "Run > spellingbee"
    REM (Use that command to initiate the audio-visual testing process)
    REM HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
    REM spellingbee.exe = C:\data\database\tts\spellingbee.bat
    REM 3. Optionally, choose a filespecs for the spell txt, err & tmp files
    REM Note any explicit path is optional (it can be %TEMP% as the default).
    REM spelltxt.txt is manually maintained redsquiggled words (1 per line)
    REM spelltxt.err is a dynamic error file autocreated & automaintained
    REM spelltxt.tmp is a dynamic tmp file autocreated by this script
    REM Note: %TEMP% defaults to C:\Users\<username>\AppData\Local\Temp\
    REM Recommended daily-use model
    REM 4. Ad hoc, as words are redsquiggled, rightclick, correct & copy...
    REM Run > spell
    REM Paste the now-correctly-spelled redsquiggle into that spell.txt file
    REM Note: Most people pin a "Run" shortcut icon to their Win10 taskbar.
    REM Note: Otherwise, they press "Windows+R" to pop up the Run box.
    REM 5. Periodically, as needed, to refresh & reinforce spelling memory...
    REM Run > spellingbee
    REM a. Speaks words you previously doubly misspelled (in spellerr.txt)
    REM (if you spell it incorrectly, another entry is added)
    REM (if you spell it correctly, only one entry is removed)
    REM b. Then randomly speaks the list of misspelled words (in spelltxt.txt)
    REM (if you spell it incorrectly, one entry is added to the error file)
    REM (if you spell it correctly, it moves to the next word in the file)
    REM The more you misspell a word, the more it shows up in the error file.
    REM Each time a word is presented you have two chances to spell it out.
    REM The more you correctly spell it, the less it shows up.
    REM When incorrect, a "pause" allows timely introspection of errors.
    REM Pressing "x" will end the session (as will pressing "Control+C").
    REM
    REM Please choose a desired filespec for the spelling text, error & temp files.
    REM set spelltxtfile=%TEMP%\spelltxt.txt
    REM set spellerrfile=%TEMP%\spellerr.txt
    REM set spelltmpfile=%TEMP%\spelltmp.txt
    set spelltxtfile=C:\data\database\tts\spelltxt.txt
    set spellerrfile=C:\data\database\tts\spellerr.txt
    set spelltmpfile=C:\data\database\tts\spelltmp.txt
    MODE CON: COLS=50 LINES=10
    color f0
    cls
    echo createobject("sapi.spvoice").speak wsh.arguments(0)>speak.vbs

    for /f "tokens=*" %%i in (%spelltxtfile%) do call echo %%random%% %%i>>%spellerrfile%
    sort /o %spelltmpfile% %spellerrfile%
    del %spellerrfile%
    set /a ok=0
    set /a not_ok=0

    for /f "tokens=1*" %%i in (%spelltmpfile%) do call :sub %%j
    :end
    del speak.vbs
    del %spelltmpfile%
    echo.
    echo %ok% words correct, %not_ok% words incorrect
    echo.
    pause
    exit

    :sub
    echo.
    set /a n=0
    :sub1
    set /a n=n+1
    if %n%==3 goto :sub2
    cscript //nologo speak.vbs "%*"
    set a=
    set /p a=
    if /i "%a%"=="x" goto :end
    if /i not "%*"=="%a%" goto :sub1
    set /a ok=ok+1
    goto :eof

    :sub2
    echo 0 %*>>%spellerrfile%
    echo ---------- %*
    timeout /t 4 >nul
    set /a not_ok=not_ok+1
    --- Synchronet 3.21d-Linux NewsLink 1.2