<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML lang="en">
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<link href="style.css" rel="stylesheet" type="text/css">
<title>4.1. NppExec's Console behaviour</title>
<script src="show_matches.js" type="text/javascript"></script>
</HEAD>
<BODY>
<h3>4.1. NppExec's Console behaviour</h3>
<p>By default, NppExec's Console is automatically shown each time you execute some NppExec's script. The reason is simple: usually script execution assumes some output which is needed or at least may be usefull for user. </p>
<p>However, you may want some of your scripts to be executed silently (i.e. without showing NppExec's Console) or even want to force NppExec's Console to be closed. And NppExec allows you to do this using its command NPP_CONSOLE.</p>
<p>You can use</p>
<blockquote>
  <pre>NPP_CONSOLE ?</pre>
</blockquote>
<p>in the beginning of your script in order to keep current Console's state. It means that hidden (closed) Console remains hidden and shown (opened) Console remains shown.</p>
<p>Also you can use</p>
<blockquote>
  <pre>NPP_CONSOLE 0</pre>
</blockquote>
<p>to hide the Console, and</p>
<blockquote>
  <pre>NPP_CONSOLE 1</pre>
</blockquote>
<p>to show the Console during script execution.</p>
<p>Type &quot;help npp_console&quot; in NppExec's Console for more details.</p>
<p>By default, NppExec's Console is automatically cleared each time you execute some NppExec's script. However, you can use</p>
<blockquote>
  <pre>NPE_CONSOLE a+</pre>
</blockquote>
<p>to enable the &quot;append&quot; mode which keeps the previous Console's text and does not clear it.</p>
<p>Type &quot;help npe_console&quot; in NppExec's Console for more details.</p>
<p>To set the keyboard focus to NppExec's Console, use</p>
<blockquote>
  <pre>NPP_SETFOCUS Con</pre>
</blockquote>
<p>Type &quot;help npp_setfocus&quot; in NppExec's Console for more details.</p>
<p>By default, when &quot;Toggle NppExec Console&quot; (Ctrl+~) switches from NppExec's Console to Notepad++'s editing window, the Console remains visible. If you want NppExec's Console to become hidden when switching to Notepad++'s editing window, do the following:</p>
<ol>
  <li>in NppExec's Console, press Ctrl+F or F7 to show the search pane;</li>
  <li>in the search pane, check &quot;Hide toggled Console&quot;.</li>
</ol>
<p>See also: NppExec's Console <a href="3.5.html">[3.5]</a>; Console output redirection <a href="4.5.html">[4.5]</a>.</p>
</BODY>
</HTML>
