<?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[Pythonscript: Is there a way to detect changes in bookmarks?]]></title><description><![CDATA[<p dir="auto">My need is to detect any addition or removal of bookmarks.</p>
<p dir="auto">The closest I have found is the callback SCINTILLANOTIFICATION.MARGINCLICK, which works fine if you edit bookmarks from the left margin, but cannot detect if they are edited in any other way (shortcuts, macros, toolbar, menu, plugin GUI).</p>
<p dir="auto">Any kind of suggestions or help will be greatly appreciated.<br />
Thanks</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21083/pythonscript-is-there-a-way-to-detect-changes-in-bookmarks</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 02:07:43 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21083.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 27 Apr 2021 13:58:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Pythonscript: Is there a way to detect changes in bookmarks? on Tue, 20 Dec 2022 22:52:28 GMT]]></title><description><![CDATA[<p dir="auto">The marker ID used for bookmarks changed in Notepad++ 8.4.6 (and later).  It is now 20, instead of 24.  So, all references to 24 in this thread and/or its script(s), should be changed to 20.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/82619</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/82619</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 20 Dec 2022 22:52:28 GMT</pubDate></item><item><title><![CDATA[Reply to Pythonscript: Is there a way to detect changes in bookmarks? on Wed, 28 Apr 2021 19:03:13 GMT]]></title><description><![CDATA[<p dir="auto">That’s exactly what I was hoping for.<br />
I would never have succeeded by myself.<br />
Thanks a lot to both of you!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/65430</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/65430</guid><dc:creator><![CDATA[kiyn]]></dc:creator><pubDate>Wed, 28 Apr 2021 19:03:13 GMT</pubDate></item><item><title><![CDATA[Reply to Pythonscript: Is there a way to detect changes in bookmarks? on Tue, 27 Apr 2021 21:18:12 GMT]]></title><description><![CDATA[<p dir="auto">I guess we can refine it a bit more, in order to tell a placement from a removal:</p>
<pre><code class="language-z"># -*- coding: utf-8 -*-

from Npp import editor, SCINTILLANOTIFICATION, MODIFICATIONFLAGS

MARK_BOOKMARK = 24  # from N++ source code

def callback_sci_MODIFIED(args):
    if args['modificationType'] &amp; MODIFICATIONFLAGS.CHANGEMARKER:
        line = editor.lineFromPosition(args['position'])
        if editor.markerGet(line) &amp; (1 &lt;&lt; MARK_BOOKMARK):
            print('bookmark placed on line {}'.format(line + 1))
        else:
            print('bookmark removed on line {}'.format(line + 1))
editor.callback(callback_sci_MODIFIED, [SCINTILLANOTIFICATION.MODIFIED])
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/65374</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/65374</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 27 Apr 2021 21:18:12 GMT</pubDate></item><item><title><![CDATA[Reply to Pythonscript: Is there a way to detect changes in bookmarks? on Tue, 27 Apr 2021 21:06:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> said in <a href="/post/65368">Pythonscript: Is there a way to detect changes in bookmarks?</a>:</p>
<blockquote>
<p dir="auto">I don’t think you’re going to be able to get anything like a “notification” about this</p>
</blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a> said:</p>
<blockquote>
<p dir="auto">You can catch the SCN_MODIFIED notification and check for the SC_MOD_CHANGEMARKER flag.</p>
</blockquote>
<p dir="auto">I love to be wrong, especially when we get increased functionality from my wrongness.  :-)</p>
<p dir="auto">Here’s a PS demo of what dail expressed above:</p>
<pre><code class="language-z"># -*- coding: utf-8 -*-

from Npp import editor, SCINTILLANOTIFICATION, MODIFICATIONFLAGS

def callback_sci_MODIFIED(args):
    if args['modificationType'] &amp; MODIFICATIONFLAGS.CHANGEMARKER:
        line = editor.lineFromPosition(args['position'])
        print('bookmark placed/removed on line {}'.format(line + 1))
editor.callback(callback_sci_MODIFIED, [SCINTILLANOTIFICATION.MODIFIED])
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/65373</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/65373</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 27 Apr 2021 21:06:16 GMT</pubDate></item><item><title><![CDATA[Reply to Pythonscript: Is there a way to detect changes in bookmarks? on Tue, 27 Apr 2021 20:29:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kiyn" aria-label="Profile: kiyn">@<bdi>kiyn</bdi></a></p>
<p dir="auto">You can catch the SCN_MODIFIED notification and check for the SC_MOD_CHANGEMARKER flag.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/65372</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/65372</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Tue, 27 Apr 2021 20:29:53 GMT</pubDate></item><item><title><![CDATA[Reply to Pythonscript: Is there a way to detect changes in bookmarks? on Tue, 27 Apr 2021 14:04:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kiyn" aria-label="Profile: kiyn">@<bdi>kiyn</bdi></a></p>
<p dir="auto">I don’t think you’re going to be able to get anything like a “notification” about this.  Meaning that you would likely have to resort to a “polling” approach, where you examine every line in a file as to whether it current has or doesn’t have a bookmark.  This is probably not the answer you wanted. :-(</p>
]]></description><link>https://community.notepad-plus-plus.org/post/65368</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/65368</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 27 Apr 2021 14:04:21 GMT</pubDate></item></channel></rss>