<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[.LOG updates]]></title><description><![CDATA[<p dir="auto">windows NOTEPAD, writes DATE and TIME each time file is updated when includes .LOG like first line into a file.</p>
<p dir="auto">NOTEPAD++ would be nice to include it too, does not ?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/24650/log-updates</link><generator>RSS for Node</generator><lastBuildDate>Wed, 10 Jun 2026 09:10:40 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/24650.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Jun 2023 18:24:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to .LOG updates on Fri, 30 Jun 2023 13:56:30 GMT]]></title><description><![CDATA[<p dir="auto">After I and <a class="plugin-mentions-user plugin-mentions-a" href="/user/rdipardo" aria-label="Profile: rdipardo">@<bdi>rdipardo</bdi></a> had both separately confirmed that MS notepad.exe really does have that feature, I decided it was worth the effort to write the script, even if the original poster never comes back to ask for it.</p>
<p dir="auto"><strong>Installation instructions</strong></p>
<ul>
<li>see full instructions in our FAQ<br />
<a href="https://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript">https://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript</a></li>
<li>save the script below as <code>DotLogTimestamp.py</code> in the PythonScript user-scripts directory (usually <code>%AppData%\Notepad++\Plugins\Config\PythonScript\Scripts\</code>)</li>
<li>if you want this feature active every time you run Notepad++:
<ol>
<li><strong>Plugins &gt; Python Script &gt; Configuration</strong>: set <strong>Initialisation</strong> to <code>ATSTARTUP</code></li>
<li>As the FAQ mentions, add the following lines to the user <code>startup.py</code></li>
</ol>
<pre><code class="language-py">import DotLogTimestamp
_DLTS = DotLogTimestamp.DLTS()
</code></pre>
</li>
</ul>
<h3>script: <code>DotLogTimestamp.py</code></h3>
<pre><code class="language-py"># encoding=utf-8
"""in response to https://community.notepad-plus-plus.org/topic/24650/

- Call this from startup.py using
import DotLogTimestamp
_DLTS = DotLogTimestamp.DLTS()

- Make sure to set Plugins &gt; PythonScript &gt; Configuration &gt; Initialisation to "ATSTARTUP" instead of "LAZY"

- installation instructions: see
    https://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript

"""
from Npp import editor,notepad,console,NOTIFICATION
from datetime import datetime

class DLTS(object):
    def __init__(self):
        console.write("Registered DotLogTimestamp.py callbacks\n")
        notepad.callback(self.fileopened_callback, [NOTIFICATION.FILEOPENED])
        notepad.callback(self.bufferactivated_callback, [NOTIFICATION.BUFFERACTIVATED])
        self.active = True
        self.bufferIDs = []

    def toggle(self):
        self.active = not self.active
        console.write("DotLogTimestamp.py callbacks are {}\n".format('active' if self.active else 'inactive'))

    def fileopened_callback(self, args):
        if self.active:
            self.bufferIDs.append(args['bufferID'])

    def bufferactivated_callback(self, args):
        if self.active:
            if args['bufferID'] in self.bufferIDs:
                line = editor.getLine(0).strip()
                if line[0:4] == ".LOG":
                    editor.appendText("{}\n".format(datetime.now().strftime("%Y-%b-%d %H:%M:%S")))
                self.bufferIDs.remove(args['bufferID'])

if __name__ == '__main__':
    try:
        _DLTS.toggle()
    except NameError:
        _DLTS = DLTS()
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/87539</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87539</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 30 Jun 2023 13:56:30 GMT</pubDate></item><item><title><![CDATA[Reply to .LOG updates on Thu, 29 Jun 2023 23:51:23 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">windows NOTEPAD, writes DATE and TIME each time file is updated when includes .LOG like first line into a file.</p>
</blockquote>
<p dir="auto">It’s true!</p>
<p dir="auto"><a href="https://gifyu.com/image/SQtbg" rel="nofollow ugc"><img src="https://camo.nodebb.org/bec26e6fc0344b7541ff4198a4cf762297ef51bd?url=https%3A%2F%2Fs12.gifyu.com%2Fimages%2FSQtbg.gif" alt="SQtbg.gif" class=" img-fluid img-markdown" /></a></p>
<p dir="auto">Looks like the timestamp is written upon <em>opening</em> the file (notice how the <code>*</code> appears immediately in the title bar), not when saving it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87525</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87525</guid><dc:creator><![CDATA[rdipardo]]></dc:creator><pubDate>Thu, 29 Jun 2023 23:51:23 GMT</pubDate></item><item><title><![CDATA[Reply to .LOG updates on Thu, 29 Jun 2023 18:37:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/clemente-rodriguez" aria-label="Profile: Clemente-Rodriguez">@<bdi>Clemente-Rodriguez</bdi></a> said in <a href="/post/87520">.LOG updates</a>:</p>
<blockquote>
<p dir="auto">windows NOTEPAD, writes DATE and TIME each time file is updated when includes .LOG like first line into a file.</p>
</blockquote>
<p dir="auto">I had never heard of that feature.  I knew that it had the F5 = Edit &gt; Time/Date to manually insert it.</p>
<blockquote>
<p dir="auto">NOTEPAD++ would be nice to include it too, does not ?</p>
</blockquote>
<p dir="auto">personally, I don’t have a need for it, though I can see why some people might like it.  If you were willing to install the <a href="https://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript">PythonScript plugin</a>, then it wouldn’t be too hard to come up with a script that could be automatically run when you start Notepad++; it would run a function every time a file was opened, and if it starts with <code>.LOG</code> as the first line, it would then append the date at the end of the file.  If you’re not interested in using the PythonScript plugin, I won’t bother explaining the details, but if you’d like that, let us know, and I or one of the other PythonScript afficionados could probably hack it together in a reasonably short amount of time.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/87521</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/87521</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 29 Jun 2023 18:37:49 GMT</pubDate></item></channel></rss>