Skip to content

Commit 7e289aa

Browse files
committed
NppExec Manual: using <em> instead of <i> where appropriate
1 parent a109e62 commit 7e289aa

File tree

6 files changed

+258
-258
lines changed

6 files changed

+258
-258
lines changed
10 Bytes
Binary file not shown.

NppExec/doc/NppExec/NppExec_Manual/4.6.13.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ <h3>4.6.13. Working with the Notepad++ 'Replace' dialog</h3>
141141
<pre> </pre>
142142
</blockquote>
143143

144-
<p>Note: If you want to find or replace some string programmatically <i>without showing the Replace dialog</i>, NppExec proposes the following commands for this: SCI_FIND and SCI_REPLACE. The actual behavior of these commands completely depend on the &lt;flags&gt; parameter specified. The description and examples are available by typing any of the following:</p>
144+
<p>Note: If you want to find or replace some string programmatically <em>without showing the Replace dialog</em>, NppExec proposes the following commands for this: SCI_FIND and SCI_REPLACE. The actual behavior of these commands completely depend on the &lt;flags&gt; parameter specified. The description and examples are available by typing any of the following:</p>
145145

146146
<blockquote>
147147
<pre>help sci_find
Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,94 @@
1-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2-
<HTML lang="en">
3-
<HEAD>
4-
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
5-
<link href="style.css" rel="stylesheet" type="text/css">
6-
<title>4.6.14. Notepad++ as a Clipboard Monitor</title>
7-
</HEAD>
8-
<BODY>
9-
<h3>4.6.14. Notepad++ as a Clipboard Monitor</h3>
10-
11-
<p>Let's imagine you want Notepad++ to work as a Clipboard Monitor by gathering all the text copied to the Clipboard into a single file shown in Notepad++.</p>
12-
<p>We may use a third-party tool such as AutoHotKey to do all the clipboard-related work, while Notepad++'s work will be to automatically refresh the file content once any text from the Clipboard has been added to this file.</p>
13-
<p>At first, let's download and install AutoHotKey v2 (https://www.autohotkey.com/).</p>
14-
<p>Secondly, let's write an AutoHotKey v2 script that will monitor the Clipboard and append the new text data to a single file. Let's accept the path to that single file as an input argument of the script:</p>
15-
16-
<blockquote>
17-
<pre>#SingleInstance Force
18-
19-
if A_Args.Length &lt; 1
20-
{
21-
MsgBox &quot;This script requires a path to an output text file as an argument!&quot;
22-
ExitApp
23-
}
24-
25-
; TempDir := EnvGet(&quot;TEMP&quot;)
26-
; ClpbrdFilePath := TempDir &quot;\clpbrd.txt&quot;
27-
ClpbrdFilePath := A_Args[1] ; reading file path as a command-line argument
28-
FileObj := FileOpen(ClpbrdFilePath, &quot;w&quot;) ; creating an empty file
29-
FileObj.Close()
30-
31-
OnClipboardChange ClipboardChanged ; clipboard callback function
32-
33-
ClipboardChanged(DataType) {
34-
if DataType = 1 { ; text
35-
FileObj := FileOpen(ClpbrdFilePath, &quot;a&quot;)
36-
FileObj.WriteLine(A_Clipboard) ; appending to the file
37-
FileObj.Close()
38-
; ToolTip &quot;Clipboard text: '&quot; A_Clipboard &quot;'&quot;
39-
; Sleep 2000
40-
; ToolTip ; Turn off the tip.
41-
}
42-
}
43-
44-
ProcessWaitClose(&quot;notepad++.exe&quot;) ; be active while Notepad++ is active
45-
ExitApp</pre>
46-
</blockquote>
47-
48-
<p>Let's save this script file as e.g. &quot;C:\AutoHotkeyScripts\NppClipboardMonitor.ahk&quot;.</p>
49-
<p>Now let's write NppExec's script that will use the AutoHotKey v2 script mentioned above. (If you don't have the NppExec plugin, install it via Plugins -&gt; Plugins Admin... first). In Notepad++, select Plugins -&gt; NppExec -&gt; Execute NppExec Script... and type the following in the opened dialog:</p>
50-
51-
<blockquote>
52-
<pre>npp_console ?
53-
set local cbfile = $(SYS.TEMP)\clpbrd.txt
54-
set local ah2script = C:\AutoHotkeyScripts\NppClipboardMonitor.ahk
55-
npp_run &quot;C:\Program Files\AutoHotkey\v2\AutoHotkey32.exe&quot; &quot;$(ah2script)&quot; &quot;$(cbfile)&quot;
56-
npp_close &quot;$(cbfile)&quot;
57-
npp_open &quot;$(cbfile)&quot;
58-
npp_menucommand View|Monitoring (tail -f)</pre>
59-
</blockquote>
60-
61-
<p>This assumes AutoHotKey v2 was installed to &quot;C:\Program Files\AutoHotkey\v2&quot; and Notepad++'s interface uses English localization. If Notepad++'s localization is different than English, please change the line</p>
62-
<blockquote>
63-
<pre>npp_menucommand View|Monitoring (tail -f)</pre>
64-
</blockquote>
65-
<p>to the one corresponding to your Notepad++'s localization. Alternatively, you can use</p>
66-
<blockquote>
67-
<pre>npp_sendmsg NPPM_SETMENUITEMCHECK IDM_VIEW_MONITORING 1</pre>
68-
</blockquote>
69-
<p>to enable the monitoring, and</p>
70-
<blockquote>
71-
<pre>npp_sendmsg NPPM_SETMENUITEMCHECK IDM_VIEW_MONITORING 0</pre>
72-
</blockquote>
73-
<p>to disable the monitoring.</p>
74-
75-
<p>Let's save the NppExec's script above as &quot;clipboard monitor&quot;. To do it, press the &quot;Save...&quot; button, type &quot;clipboard monitor&quot; (without the quotes) and press &quot;Save&quot;.</p>
76-
<p>Now you may want to assign a shortcut key to this NppExec's script. To do that, select Plugins -&gt; NppExec -&gt; Advanced Options... and click the &quot;Associated script:&quot; combo-box in the bottom part of the opened dialog. Select the &quot;clipboard monitor&quot; item in the drop-down list and press &quot;Add/Modify&quot;. A new item &quot;clipboard monitor :: clipboard monitor&quot; will be added to the &quot;Menu items&quot; list. When you finally press &quot;OK&quot;, there will be a message &quot;Notepad++ must be restarted to apply some of the options&quot;. This is required to add a new menu item &quot;clipboard monitor&quot; to Notepad++.</p>
77-
<p>When Notepad++ is restarted, a shortcut key can be assigned to the new menu item &quot;clipboard monitor&quot;. In Notepad++, select Settings -&gt; Shortcut Mapper... and click &quot;Plugin commands&quot;. Find the &quot;clipboard monitor&quot; command that corresponds to &quot;NppExec.dll&quot; and assign a desired shortcut key to it.</p>
78-
<p>Everything is ready!</p>
79-
<p>Now either press the shortcut key assigned to the &quot;clipboard monitor&quot; menu item or select Plugins -&gt; NppExec -&gt; Execute NppExec Script... and then select &quot;clipboard monitor&quot; in the combo-box at the bottom of the opened dialog and finally press &quot;OK&quot;. You'll see an empty file &quot;clpbrd.txt&quot; opened in Notepad++.</p>
80-
<p>Now, copy any text to the Clipboard in any program - and that exact text should be appended to the &quot;clpbrd.txt&quot; file content shown in Notepad++.</p>
81-
<p>Final words. If you close and/or reopen this file (the &quot;clpbrd.txt&quot; one) in Notepad++ or if you restart Notepad++, don't forget to run the &quot;clipboard monitor&quot; NppExec's script again in order to monitor the Clipboard. Otherwise the &quot;clpbrd.txt&quot; will be a simple text file. (Because in fact it <i>is</i> a simple text file). As we discussed above, all the clipboard monitoring work is done by AutoHotKey. Correspondingly, when the AutoHotKey v2 script is running, you may find the AutoHotKey's icon in the TaskBar, as well as right-click that icon and select &quot;Exit&quot; to exit AutoHotKey. In such case, you'll again have to run the &quot;clipboard monitor&quot; NppExec's script manually in order to monitor the Clipboard. No magic here, just dexterous hands :-)</p>
82-
83-
<blockquote>
84-
<pre> </pre>
85-
</blockquote>
86-
87-
<p>See also: Clipboard, keystrokes and much more <a href="4.6.8.html">[4.6.8]</a>.</p>
88-
89-
<blockquote>
90-
<pre> </pre>
91-
</blockquote>
92-
93-
</BODY>
94-
</HTML>
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2+
<HTML lang="en">
3+
<HEAD>
4+
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
5+
<link href="style.css" rel="stylesheet" type="text/css">
6+
<title>4.6.14. Notepad++ as a Clipboard Monitor</title>
7+
</HEAD>
8+
<BODY>
9+
<h3>4.6.14. Notepad++ as a Clipboard Monitor</h3>
10+
11+
<p>Let's imagine you want Notepad++ to work as a Clipboard Monitor by gathering all the text copied to the Clipboard into a single file shown in Notepad++.</p>
12+
<p>We may use a third-party tool such as AutoHotKey to do all the clipboard-related work, while Notepad++'s work will be to automatically refresh the file content once any text from the Clipboard has been added to this file.</p>
13+
<p>At first, let's download and install AutoHotKey v2 (https://www.autohotkey.com/).</p>
14+
<p>Secondly, let's write an AutoHotKey v2 script that will monitor the Clipboard and append the new text data to a single file. Let's accept the path to that single file as an input argument of the script:</p>
15+
16+
<blockquote>
17+
<pre>#SingleInstance Force
18+
19+
if A_Args.Length &lt; 1
20+
{
21+
MsgBox &quot;This script requires a path to an output text file as an argument!&quot;
22+
ExitApp
23+
}
24+
25+
; TempDir := EnvGet(&quot;TEMP&quot;)
26+
; ClpbrdFilePath := TempDir &quot;\clpbrd.txt&quot;
27+
ClpbrdFilePath := A_Args[1] ; reading file path as a command-line argument
28+
FileObj := FileOpen(ClpbrdFilePath, &quot;w&quot;) ; creating an empty file
29+
FileObj.Close()
30+
31+
OnClipboardChange ClipboardChanged ; clipboard callback function
32+
33+
ClipboardChanged(DataType) {
34+
if DataType = 1 { ; text
35+
FileObj := FileOpen(ClpbrdFilePath, &quot;a&quot;)
36+
FileObj.WriteLine(A_Clipboard) ; appending to the file
37+
FileObj.Close()
38+
; ToolTip &quot;Clipboard text: '&quot; A_Clipboard &quot;'&quot;
39+
; Sleep 2000
40+
; ToolTip ; Turn off the tip.
41+
}
42+
}
43+
44+
ProcessWaitClose(&quot;notepad++.exe&quot;) ; be active while Notepad++ is active
45+
ExitApp</pre>
46+
</blockquote>
47+
48+
<p>Let's save this script file as e.g. &quot;C:\AutoHotkeyScripts\NppClipboardMonitor.ahk&quot;.</p>
49+
<p>Now let's write NppExec's script that will use the AutoHotKey v2 script mentioned above. (If you don't have the NppExec plugin, install it via Plugins -&gt; Plugins Admin... first). In Notepad++, select Plugins -&gt; NppExec -&gt; Execute NppExec Script... and type the following in the opened dialog:</p>
50+
51+
<blockquote>
52+
<pre>npp_console ?
53+
set local cbfile = $(SYS.TEMP)\clpbrd.txt
54+
set local ah2script = C:\AutoHotkeyScripts\NppClipboardMonitor.ahk
55+
npp_run &quot;C:\Program Files\AutoHotkey\v2\AutoHotkey32.exe&quot; &quot;$(ah2script)&quot; &quot;$(cbfile)&quot;
56+
npp_close &quot;$(cbfile)&quot;
57+
npp_open &quot;$(cbfile)&quot;
58+
npp_menucommand View|Monitoring (tail -f)</pre>
59+
</blockquote>
60+
61+
<p>This assumes AutoHotKey v2 was installed to &quot;C:\Program Files\AutoHotkey\v2&quot; and Notepad++'s interface uses English localization. If Notepad++'s localization is different than English, please change the line</p>
62+
<blockquote>
63+
<pre>npp_menucommand View|Monitoring (tail -f)</pre>
64+
</blockquote>
65+
<p>to the one corresponding to your Notepad++'s localization. Alternatively, you can use</p>
66+
<blockquote>
67+
<pre>npp_sendmsg NPPM_SETMENUITEMCHECK IDM_VIEW_MONITORING 1</pre>
68+
</blockquote>
69+
<p>to enable the monitoring, and</p>
70+
<blockquote>
71+
<pre>npp_sendmsg NPPM_SETMENUITEMCHECK IDM_VIEW_MONITORING 0</pre>
72+
</blockquote>
73+
<p>to disable the monitoring.</p>
74+
75+
<p>Let's save the NppExec's script above as &quot;clipboard monitor&quot;. To do it, press the &quot;Save...&quot; button, type &quot;clipboard monitor&quot; (without the quotes) and press &quot;Save&quot;.</p>
76+
<p>Now you may want to assign a shortcut key to this NppExec's script. To do that, select Plugins -&gt; NppExec -&gt; Advanced Options... and click the &quot;Associated script:&quot; combo-box in the bottom part of the opened dialog. Select the &quot;clipboard monitor&quot; item in the drop-down list and press &quot;Add/Modify&quot;. A new item &quot;clipboard monitor :: clipboard monitor&quot; will be added to the &quot;Menu items&quot; list. When you finally press &quot;OK&quot;, there will be a message &quot;Notepad++ must be restarted to apply some of the options&quot;. This is required to add a new menu item &quot;clipboard monitor&quot; to Notepad++.</p>
77+
<p>When Notepad++ is restarted, a shortcut key can be assigned to the new menu item &quot;clipboard monitor&quot;. In Notepad++, select Settings -&gt; Shortcut Mapper... and click &quot;Plugin commands&quot;. Find the &quot;clipboard monitor&quot; command that corresponds to &quot;NppExec.dll&quot; and assign a desired shortcut key to it.</p>
78+
<p>Everything is ready!</p>
79+
<p>Now either press the shortcut key assigned to the &quot;clipboard monitor&quot; menu item or select Plugins -&gt; NppExec -&gt; Execute NppExec Script... and then select &quot;clipboard monitor&quot; in the combo-box at the bottom of the opened dialog and finally press &quot;OK&quot;. You'll see an empty file &quot;clpbrd.txt&quot; opened in Notepad++.</p>
80+
<p>Now, copy any text to the Clipboard in any program - and that exact text should be appended to the &quot;clpbrd.txt&quot; file content shown in Notepad++.</p>
81+
<p>Final words. If you close and/or reopen this file (the &quot;clpbrd.txt&quot; one) in Notepad++ or if you restart Notepad++, don't forget to run the &quot;clipboard monitor&quot; NppExec's script again in order to monitor the Clipboard. Otherwise the &quot;clpbrd.txt&quot; will be a simple text file. (Because in fact it <em>is</em> a simple text file). As we discussed above, all the clipboard monitoring work is done by AutoHotKey. Correspondingly, when the AutoHotKey v2 script is running, you may find the AutoHotKey's icon in the TaskBar, as well as right-click that icon and select &quot;Exit&quot; to exit AutoHotKey. In such case, you'll again have to run the &quot;clipboard monitor&quot; NppExec's script manually in order to monitor the Clipboard. No magic here, just dexterous hands :-)</p>
82+
83+
<blockquote>
84+
<pre> </pre>
85+
</blockquote>
86+
87+
<p>See also: Clipboard, keystrokes and much more <a href="4.6.8.html">[4.6.8]</a>.</p>
88+
89+
<blockquote>
90+
<pre> </pre>
91+
</blockquote>
92+
93+
</BODY>
94+
</HTML>

0 commit comments

Comments
 (0)