• Windows right click new text file template

    From Peter@21:1/5 to All on Mon Mar 6 15:18:02 2023
    I often create new text files which I then have to import a template into
    as the first step.

    Can I skip that text file template import step?

    Is there a way in Windows to make a new text file which is (essentially) a template (it contains a pre-formatted set of sections to be filled out)?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Graham J@21:1/5 to Peter on Mon Mar 6 17:48:21 2023
    Peter wrote:
    I often create new text files which I then have to import a template into
    as the first step.

    Can I skip that text file template import step?

    Is there a way in Windows to make a new text file which is (essentially) a template (it contains a pre-formatted set of sections to be filled out)?


    Is this a text file such as you would edit with notepad.exe?

    If so, store your template file somewhere obvious, open it whenever you
    want to create a new file, then "save as" the desired file name in your
    desired location.

    If you really mean a file created with Microft Word, make a template
    file and save it where Microsoft tells you. May be best to Google how to
    do this. Then when you create a new file, start Word and navigate to
    your template, then fill in your details and save the file as you wish.

    --
    Graham J

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nil@21:1/5 to Peter on Mon Mar 6 13:43:35 2023
    On 06 Mar 2023, Peter <occassionally-confused@nospam.co.uk> wrote in alt.comp.os.windows-10:

    I often create new text files which I then have to import a
    template into as the first step.

    Can I skip that text file template import step?

    Is there a way in Windows to make a new text file which is
    (essentially) a template (it contains a pre-formatted set of
    sections to be filled out)?

    I don't see a native Windows way to do that for text files, and Notepad
    doesn't have a Templates feature, but you may be able to find another
    text editor with equivalent functionality. For one, Notepad++ has a
    plug-in called Snippets that lets you paste in any pre-written text
    with a keystroke. You could also do it with a macro or scripting with Pythonscript.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From sticks@21:1/5 to Peter on Mon Mar 6 13:01:50 2023
    On 3/6/2023 12:46 PM, Peter wrote:

    All I want is Microsoft's "New > Text Document" to create is a file that is the same format as their file but which is actually my formatted text file.

    You could just create the file as you like it and save it to your
    desktop if you use this often. Then just click on it when you wish to
    use it and immediately save it as what you want. When your done, your
    original template will still be there for the next time, requiring only
    a click again to open anew.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter@21:1/5 to Graham J on Mon Mar 6 18:46:27 2023
    Graham J <nobody@nowhere.co.uk> wrote:

    Is this a text file such as you would edit with notepad.exe?

    It's the file created by the Windows 10 "New > Text Document" command.

    If so, store your template file somewhere obvious, open it whenever you
    want to create a new file, then "save as" the desired file name in your desired location.

    If you really mean a file created with Microft Word, make a template
    file and save it where Microsoft tells you. May be best to Google how to
    do this. Then when you create a new file, start Word and navigate to
    your template, then fill in your details and save the file as you wish.

    I don't know how Microsoft Word got into the picture.

    All I want is Microsoft's "New > Text Document" to create is a file that is
    the same format as their file but which is actually my formatted text file.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter@21:1/5 to sticks on Mon Mar 6 19:10:04 2023
    sticks <wolverine01@charter.net> wrote:
    All I want is Microsoft's "New > Text Document" to create is a file that is >> the same format as their file but which is actually my formatted text file.

    You could just create the file as you like it and save it to your
    desktop if you use this often. Then just click on it when you wish to
    use it and immediately save it as what you want. When your done, your original template will still be there for the next time, requiring only
    a click again to open anew.

    I should have said I know all about that.

    I already use a process of including the template as the first step once I
    open the blank text file created by Microsoft's "New > Text Document" in
    gvim (<escape><colon><r> c:\path\mytempate.txt in gvim command language).

    I don't want to do that fifty times a day.
    I want the new text document to be the one that I already want it to be.

    I don't know where Windows stores the blank template but it has to be
    stored somewhere. I suspect I need to find where it is stored & change it.

    Either I can change the actual system template for New > Text Document.
    Or I can maybe change the pointer to where that system template resides.

    If I knew how to do that, I wouldn't be asking.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nil@21:1/5 to Peter on Mon Mar 6 14:31:03 2023
    On 06 Mar 2023, Peter <occassionally-confused@nospam.co.uk> wrote in alt.comp.os.windows-10:

    I don't know where Windows stores the blank template but it has to
    be stored somewhere. I suspect I need to find where it is stored &
    change it.

    Either I can change the actual system template for New > Text
    Document. Or I can maybe change the pointer to where that system
    template resides.

    Windows does not have that native ability. There is no "system
    template" for text files.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From knuttle@21:1/5 to Nil on Mon Mar 6 15:21:40 2023
    On 3/6/2023 2:31 PM, Nil wrote:
    On 06 Mar 2023, Peter <occassionally-confused@nospam.co.uk> wrote in alt.comp.os.windows-10:

    I don't know where Windows stores the blank template but it has to
    be stored somewhere. I suspect I need to find where it is stored &
    change it.

    Either I can change the actual system template for New > Text
    Document. Or I can maybe change the pointer to where that system
    template resides.

    Windows does not have that native ability. There is no "system
    template" for text files.
    I don't know what I have done different from every one else, but when I
    right click and select NEW, I have the option of creating 9 different templates. One is for an image using Irfanview, One is a Windows System Contact, One is for Notepad, one is for a compressed file, and 5 are for
    files using the different modules of Corel Office Suit. (I believe on
    a computer with MS office you have options for MS files.)

    With Word Perfect you can change the standard document template so I
    assume that could be put on the NEW Menu.

    I never use the NEW menu to create documents, but do it from the program
    itself

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From sticks@21:1/5 to knuttle on Mon Mar 6 14:30:22 2023
    On 3/6/2023 2:21 PM, knuttle wrote:
    On 3/6/2023 2:31 PM, Nil wrote:
    On 06 Mar 2023, Peter <occassionally-confused@nospam.co.uk> wrote in
    alt.comp.os.windows-10:

    I don't know where Windows stores the blank template but it has to
    be stored somewhere. I suspect I need to find where it is stored &
    change it.

    Either I can change the actual system template for New > Text
    Document. Or I can maybe change the pointer to where that system
    template resides.

    Windows does not have that native ability. There is no "system
    template" for text files.
    I don't know what I have done different from every one else, but when I
    right click and select NEW, I have the option of creating 9 different templates.  One is for an image using Irfanview, One is a Windows System Contact, One is for Notepad, one is for a compressed file, and 5 are for files using the different modules of Corel Office Suit.   (I believe on
    a computer with MS office you have options for MS files.)

    With Word Perfect you can change the standard document template so I
    assume that could be put on the NEW Menu.

    I never use the NEW menu to create documents, but do it from the program itself

    If you had notepad on the taskbar, you could set up the templatein
    notepad and give it a temporary name and close it. Then by right
    clicking on the notebook taskbar icon it would be in the recent
    documents at the top and one click would open it up for use. Basically
    the same thing as leaving it on the desktop, but less clutter as you
    could leave it wherever you want.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Char Jackson@21:1/5 to All on Mon Mar 6 14:19:10 2023
    On Mon, 06 Mar 2023 14:31:03 -0500, Nil <rednoise9@rednoise9.invalid>
    wrote:

    On 06 Mar 2023, Peter <occassionally-confused@nospam.co.uk> wrote in >alt.comp.os.windows-10:

    I don't know where Windows stores the blank template but it has to
    be stored somewhere. I suspect I need to find where it is stored &
    change it.

    Either I can change the actual system template for New > Text
    Document. Or I can maybe change the pointer to where that system
    template resides.

    Windows does not have that native ability. There is no "system
    template" for text files.

    Sounds like a job for one of those hotkey automation/macro apps, like AutoHotkey or AutiIt, etc.

    Press a hotkey and a new text file is created, template text inserted,
    ready for additional text and whatever comes next.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to Peter on Mon Mar 6 16:01:19 2023
    On 3/6/2023 10:18 AM, Peter wrote:
    I often create new text files which I then have to import a template into
    as the first step.

    Can I skip that text file template import step?

    Is there a way in Windows to make a new text file which is (essentially) a template (it contains a pre-formatted set of sections to be filled out)?


    The items that "New" offers, appear to be packaged inside shell32.dll.
    There's probably an entry point which does this. There's the usual
    CLSID (or some kind of string of numbers) to identify it.

    Sometimes, the shell32.dll provides a "nugget" which, together with
    some registry magic, creates a custom command. "Open Command Window Here"
    is an example. Copies of these links can be obtained using www.archive.org (that's how I obtained the pasted stuff below). Generally, when you create
    a .reg file to "Merge" into the registry, you create a removal .reg file to compliment it later (for removal).

    https://www.sevenforums.com/attachments/tutorials/196794d1328414980-open-command-window-here-add-remove-add_open_command_window_here.reg

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Directory\shell\cmd]
    @="@shell32.dll,-8506"
    "Extended"=""
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
    @="cmd.exe /s /k pushd \"%V\""

    [HKEY_CLASSES_ROOT\Directory\Background\shell\cmd]
    @="@shell32.dll,-8506"
    "NoWorkingDirectory"=""

    [HKEY_CLASSES_ROOT\Directory\Background\shell\cmd\command]
    @="cmd.exe /s /k pushd \"%V\""

    https://www.sevenforums.com/attachments/tutorials/196795d1328414980-open-command-window-here-add-remove-remove_open_command_window_here.reg

    Windows Registry Editor Version 5.00

    [-HKEY_CLASSES_ROOT\Directory\shell\cmd]

    [-HKEY_CLASSES_ROOT\Directory\Background\shell\cmd]

    ***************************************************

    Notice, that the example above, the text string to be
    shown in the context menu is pre-defined by shell32.dll
    entry point. @="@shell32.dll,-8506"

    In this example, they provide a static text string in
    the Registry, to label their creation.

    https://superuser.com/questions/890136/modify-open-command-window-here-context-menu-call

    @="Open CMDER here"

    ***************************************************

    You might ask yourself, why am I showing you all this "crap".

    It's the component parts that count.

    "%V" <=== with escape characters removed, this magical thing is
    the absolute path of the folder where you used the
    context menu. If you want to drop a template file
    into the $CWD, then this baby is your path for the command.
    The reason they wrapped in in escaped double-quotes, is
    so any spaces in the absolute path, will not "break" the syntax.
    Even the thing on the end, the text file name with spaces, this
    entire string has to be wrapped like that.

    copy <static-path-of-template>\template.txt "%V"\New Text Document.txt

    So that's sorta the command we want to run.

    You can run cmd.exe and pass it a command string to run. So you
    are forking a shell (cmd.exe) and one command (copy) runs in it,
    to put the template there. Typically, a command is wrapped in
    double-quotes, but one of the items in the command, is also
    wrapped in double-quotes (uh oh).

    Is the syntax of this command going to be complicated ?
    You bet your ass it'll be complicated, and that's why I'm not doing it :-)
    It will be a royal pain to get this working. But, that's half the fun.
    But at least in the Superuser example, you can follow the logic
    of someone creating a custom item, an item custom enough it uses
    a static text string for a label.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralph Fox@21:1/5 to Peter on Tue Mar 7 18:24:31 2023
    On Mon, 6 Mar 2023 15:18:02 +0000, Peter wrote:

    I often create new text files which I then have to import a template into
    as the first step.

    Can I skip that text file template import step?

    Is there a way in Windows to make a new text file which is (essentially) a template (it contains a pre-formatted set of sections to be filled out)?


    See this from Microsoft:

    Extending the New Submenu
    <https://learn.microsoft.com/en-us/windows/win32/shell/context#extending-the-new-submenu>

    As I read it, you can have at most one template per file extension.

    For your request, the registry entry for .txt files already has
    a ShellNew which creates an empty file. You would want to change
    the existing registry entries to create a file from your template.


    --
    Kind regards
    Ralph

    ‘Este bueþ oune brondes,’ quoþ Hendyng.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)