<?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[Automate&#x2F;Schedule a Macro]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I’ve created a macro that I would like to run at a scheduled interval, e.g. every 15 min.</p>
<p dir="auto">Is there a way to schedule a macro to run?</p>
<p dir="auto">Thanks,<br />
Pat</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/16746/automate-schedule-a-macro</link><generator>RSS for Node</generator><lastBuildDate>Mon, 18 May 2026 02:37:58 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/16746.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Dec 2018 20:41:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Mon, 10 Dec 2018 13:54:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/scott-sumner" aria-label="Profile: Scott-Sumner">@<bdi>Scott-Sumner</bdi></a></p>
<p dir="auto">Hmm, the plugin itself does nearly nothing when it is loaded, it only adds its menu entries to the Notepad++ UI. Only when you click on the <em>Spy!</em> menu entry it examines the main menu and the toolbar of Notepad++ and fills its trees. All these data gets thrown away when you close the dialog.</p>
<p dir="auto">But it is a Delphi application and as such it incorporates the needed parts of the VCL (Visual Component Library), the abstraction layer of Delphi for the Win32 API. In this context it loads a noticeable amount of Windows DLL files. Maybe this causes the increased load time.</p>
<p dir="auto">I have installed about to 45 plugins, thus my Notepad++ needs some time to start up anyway and I was not aware of an increased load time after adding the new plugin.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/37337</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37337</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Mon, 10 Dec 2018 13:54:48 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Mon, 10 Dec 2018 13:28:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a></p>
<p dir="auto">Does the “spy” plugin take a large amount of time to initialize when it starts up?  I added it to my setup and it seems to have some odd interactions with some of my Pythonscript stuff that runs on startup.  I haven’t investigated further yet but the first thing I noticed is that it seems to take longer now for my Notepad++ to get to a “ready for editing” state.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/37333</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37333</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Mon, 10 Dec 2018 13:28:57 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Sat, 08 Dec 2018 16:50:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a></p>
<p dir="auto">I see.  Well, we don’t <em>know</em> yet that the Pythonscript-based solution will work for the OP, so it is still nice to have other options.  BTW, I like the looks of your “spy” plugin!  (see…without the alternative solution path being presented, I never would have learned about that plugin!)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/37284</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37284</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 08 Dec 2018 16:50:48 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Sat, 08 Dec 2018 16:44:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/scott-sumner" aria-label="Profile: Scott-Sumner">@<bdi>Scott-Sumner</bdi></a> said:</p>
<blockquote>
<p dir="auto">Curious, though, why did you say “(though unnecessary)”…?</p>
</blockquote>
<p dir="auto">Because you have already posted a (I guess) working Python solution.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/37283</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37283</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Sat, 08 Dec 2018 16:44:32 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Sat, 08 Dec 2018 16:43:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dinkumoil" aria-label="Profile: dinkumoil">@<bdi>dinkumoil</bdi></a></p>
<p dir="auto">I <em>knew</em> it was going to get wild and crazy like that.  :-)</p>
<p dir="auto">It’s fine though as there is a Notepad++ tie in, so we are not getting into “off-topic” land…</p>
<p dir="auto">Curious, though, why did you say “(though unnecessary)”…?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/37282</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37282</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 08 Dec 2018 16:43:24 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Sat, 08 Dec 2018 16:39:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/scott-sumner" aria-label="Profile: Scott-Sumner">@<bdi>Scott-Sumner</bdi></a> said:</p>
<blockquote>
<p dir="auto">I’ll look forward to seeing the solution on <em>THAT</em> one.  :-)</p>
</blockquote>
<p dir="auto">Seems it’s time for another nice hackish (though unnecessary) solution. Here we go. :-)</p>
<ol>
<li>Download and install my <a href="https://github.com/dinkumoil/NppUISpy" rel="nofollow ugc"><em>NppUISpy</em> plugin</a>. Follow the instructions for its manual installation.</li>
<li>Download the tool <a href="http://www.nirsoft.net/utils/nircmd.html" rel="nofollow ugc"><em>NirCmd</em></a> (scroll down to the end of the text to find the download links) and unpack the zip file to a directory where you have write access.</li>
<li>Start Notepad++, go to <em>Plugins</em> menu and launch the <em>NppUISpy</em> plugin by clicking on its <em>Spy!</em> menu entry.</li>
<li>In the left pane of the plugin’s UI go to the tree node of the <em>Macro</em> menu and open it by clicking on the small <code>+</code> sign to its left. Find the entry of the macro you want to start and remember the related number in the <em>Command Id</em> column. <strong>Please note:</strong> The tree items respond to mouse clicks and make Notepad++ to execute the related command. Maybe you prefer to click only on the tree lines at the left and the small <code>+</code> signs to prevent that. The toolbar button items in the right pane respond to mouse clicks as well.</li>
<li>Start a console window and navigate to the directory where you have unpacked <em>NirCmd</em>.</li>
<li>Type the following command: <code>nircmdc win postmsg ititle "Notepad++" 2072 0 XXXXX</code> where <em>XXXXX</em> is the number you remembered in step 4.</li>
</ol>
<pre><code class="language-Z"></code></pre>
<p dir="auto">The command of step 6 can be put into a batch file which in turn can be executed by a scheduled task.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/37281</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37281</guid><dc:creator><![CDATA[dinkumoil]]></dc:creator><pubDate>Sat, 08 Dec 2018 16:39:14 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Sat, 08 Dec 2018 13:28:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/patrick-coleman" aria-label="Profile: Patrick-Coleman">@<bdi>Patrick-Coleman</bdi></a> said:</p>
<blockquote>
<p dir="auto">I am getting “NameError: name ‘notepad’ is not defined.”</p>
</blockquote>
<p dir="auto">You have to understand Python/Pythonscript a bit for this one.  The short story is you probably need this at the top of the script:</p>
<pre><code>from Npp import notepad
</code></pre>
<p dir="auto">For my setup, I put that line in my <code>startup.py</code> (which runs upon Notepad++/Pythonscript-plugin startup, hence its name), so I don’t have to put that in my individual script files (but you can do it that way).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/37276</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37276</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 08 Dec 2018 13:28:11 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Sat, 08 Dec 2018 13:21:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said:</p>
<blockquote>
<p dir="auto">Well, now the deal is how to connect that stuff with the action of running a macro from within N++ ;-)) Not tried, yet !</p>
</blockquote>
<p dir="auto">Yea…good luck.  I’ll look forward to seeing the solution on <em>THAT</em> one.  :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/37275</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37275</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Sat, 08 Dec 2018 13:21:41 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Sat, 08 Dec 2018 12:20:46 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/patrick-coleman" aria-label="Profile: patrick-coleman">@<bdi>patrick-coleman</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/scott-sumner" aria-label="Profile: scott-sumner">@<bdi>scott-sumner</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Just a piece of <strong>information</strong> :</p>
<p dir="auto">When you want to execute a Windows <strong>program</strong> or <strong>batch</strong> script, on <strong>specific</strong> intervals, the Microsoft <strong><code>schtasks</code></strong> utility is quite <strong>powerful</strong> ;-))</p>
<p dir="auto">For instance, the line, below, typed in a <strong>console</strong> windows, would create a task, named <strong><code>Test</code></strong> which executes the <strong><code>test.bat</code></strong> batch, located in <strong><code>\D:</code></strong> every <strong>minute</strong> :</p>
<p dir="auto"><strong><code>schtasks /create /sc minute /mo 1 /tn "Test" /tr D:\test.bat</code></strong></p>
<p dir="auto">For <strong>help</strong> on this command, which replaces, the <strong>old</strong> <strong><code>at</code></strong> command, type in <strong><code>schtasks /?</code></strong></p>
<p dir="auto">To <strong>list</strong> all the <strong>scheduled</strong> tasks, simply type <strong><code>schtasks</code></strong> and valid</p>
<p dir="auto">To <strong>delete</strong> the <strong><code>Test </code></strong> task, type in the command <strong><code>schtasks /delete /tn test</code></strong></p>
<hr />
<p dir="auto">Here is, below, the detail of the <strong><code>schtasks</code></strong> command ( Sorry, it’s written in <strong>French</strong> on my system, of course ! )</p>
<pre><code class="language-diff">SCHTASKS /paramètre [arguments]

Description :
    Permet à un administrateur de créer, supprimer, effectuer des requêtes, modifier, exécuter et
    mettre fin à des tâches planifiées sur un système local ou distant. Remplace AT.exe.

Liste de paramètres :
    /Create         Crée une nouvelle tâche planifiée.

    /Delete         Supprime les tâches planifiées.

    /Query          Affiche toutes les tâches planifiées.

    /Change         Modifie les propriétés d'une tâche planifiée.

    /Run            Exécute la tâche planifiée immédiatement.

    /End            Arrête la tâche planifiée actuellement en cours d'exécution.

    /?                             Affiche cet écran d'aide.

Exemples :
    SCHTASKS
    SCHTASKS /?
    SCHTASKS /Run /?
    SCHTASKS /End /?
    SCHTASKS /Create /?
    SCHTASKS /Delete /?
    SCHTASKS /Query  /?
    SCHTASKS /Change /?
</code></pre>
<hr />
<p dir="auto">Well, now the deal is how to <strong>connect</strong> that stuff with the action of running a <strong>macro</strong> from <strong>within</strong> N++ ;-)) Not tried, yet  !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/37272</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37272</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 08 Dec 2018 12:20:46 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Sat, 08 Dec 2018 05:02:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/scott-sumner" aria-label="Profile: Scott-Sumner">@<bdi>Scott-Sumner</bdi></a> said:</p>
<blockquote>
<p dir="auto">def timer_callback():<br />
print(‘hello world every 3 seconds!’)  # or, for example,  notepad.runMenuCommand(menuName, menuOption)<br />
threading.Timer(3.0, timer_callback).start()</p>
<p dir="auto">timer_callback()</p>
</blockquote>
<p dir="auto">Hi Scott,</p>
<p dir="auto">I tried your script as follows:</p>
<p dir="auto">def timer_callback():<br />
notepad.runMenuCommand(Macro, my-macro)<br />
threading.Timer(3.0, timer_callback).start()</p>
<p dir="auto">timer_callback()</p>
<p dir="auto">I am getting “NameError: name ‘notepad’ is not defined.”</p>
<p dir="auto">Any thoughts on how to resolve that?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/37271</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37271</guid><dc:creator><![CDATA[Patrick Coleman]]></dc:creator><pubDate>Sat, 08 Dec 2018 05:02:59 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Wed, 05 Dec 2018 15:37:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/patrick-coleman" aria-label="Profile: Patrick-Coleman">@<bdi>Patrick-Coleman</bdi></a></p>
<blockquote>
<p dir="auto">macro that I would like to run at a scheduled interval</p>
</blockquote>
<p dir="auto">This Pythonscript code shows one way of doing it:</p>
<pre><code class="language-z">import threading

def timer_callback():
    print('hello world every 3 seconds!')  # or, for example,  notepad.runMenuCommand(menuName, menuOption)
    threading.Timer(3.0, timer_callback).start()

timer_callback()
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/37177</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37177</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Wed, 05 Dec 2018 15:37:43 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Wed, 05 Dec 2018 12:38:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/patrick-coleman" aria-label="Profile: Patrick-Coleman">@<bdi>Patrick-Coleman</bdi></a></p>
<p dir="auto">you cannot use task scheduler to start a specific macro within notepad++(npp).<br />
Task scheduler can only be used to start programs like npp.<br />
May I ask you what exactly you try to do with the macro? Maybe there is a “better” way doing it.</p>
<p dir="auto">Eko</p>
]]></description><link>https://community.notepad-plus-plus.org/post/37165</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37165</guid><dc:creator><![CDATA[Eko palypse]]></dc:creator><pubDate>Wed, 05 Dec 2018 12:38:16 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Tue, 04 Dec 2018 23:46:52 GMT]]></title><description><![CDATA[<p dir="auto">I will have to dig through PythonScript when I get some time.</p>
<p dir="auto">In the mean time, I use Windows and someone suggested using Windows Task Scheduler. Any idea what file or script I would have it call to run the macro?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/37154</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37154</guid><dc:creator><![CDATA[Patrick Coleman]]></dc:creator><pubDate>Tue, 04 Dec 2018 23:46:52 GMT</pubDate></item><item><title><![CDATA[Reply to Automate&#x2F;Schedule a Macro on Tue, 04 Dec 2018 21:29:10 GMT]]></title><description><![CDATA[<p dir="auto">There isn’t a way to do that natively.</p>
<p dir="auto">However, there may be a way using one of the scripting plugins, like PythonScript (or the others listed below).  The PythonScript help lists the various notification signals that you can trap for a callback, but I didn’t see any that appeared to be timer-based – though I may have missed one.</p>
<p dir="auto">As an alternative, I am sure that Python or Lua (the programming languages, independent of the PythonScript or LuaScript plugins) have some manner of setting and handling timer-based alarms.  During your startup (for PythonScript, use the <code>startup.py</code>), set an alarm; when the alarm is handled, have it use <code>notepad.runMenuCommand()</code> (or equivalent) to call the macro, and then have it schedule itself (set the alarm) again.  I don’t know enough Python (or Lua) to work up an example for you, sorry.</p>
<p dir="auto">-----</p>
<h4>Scripting Plugins  (Links)</h4>
<ul>
<li>PythonScript
<ul>
<li><a href="http://npppythonscript.sourceforge.net/" rel="nofollow ugc">PythonScript HOME</a></li>
<li><a href="https://github.com/bruderstein/PythonScript/releases" rel="nofollow ugc">PythonScript DOWNLOAD</a></li>
<li>HELP = <code>Plugins &gt; Python Script &gt; Context-Help</code></li>
<li><a href="https://www.python.org/about/gettingstarted/" rel="nofollow ugc">Getting Started with Python</a></li>
</ul>
</li>
<li>LuaScript
<ul>
<li><a href="https://github.com/dail8859/LuaScript" rel="nofollow ugc">LuaScript HOME</a></li>
<li><a href="https://github.com/dail8859/LuaScript/releases" rel="nofollow ugc">LuaScript DOWNLOAD</a></li>
</ul>
</li>
<li>jN: JavaScript for Notepad++
<ul>
<li><a href="https://github.com/sieukrem/jn-npp-plugin/wiki" rel="nofollow ugc">jN WIKI</a></li>
<li><a href="https://github.com/sieukrem/jn-npp-plugin/releases" rel="nofollow ugc">jN DOWNLOAD</a></li>
</ul>
</li>
<li><a href="http://downloads.sourceforge.net/project/npp-plugins/" rel="nofollow ugc">NppExec</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/37152</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/37152</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 04 Dec 2018 21:29:10 GMT</pubDate></item></channel></rss>