Skip to content

Releases

v0.2.1 - Search Every Open Notepad Tab and Jump to the Window

Choose a tag to compare

@djdarcy djdarcy released this 01 Dec 10:18
v0.2.1
c05c0e8

notepad-search v0.2.1

Search the text of every open Windows 11 Notepad window and tab, and jump to the match. For people who keep dozens of Notepad windows open as working memory: type a few words, see which tabs hold them with the surrounding text, and bring the right window to the front. A plain, deterministic search in the spirit of grep; no AI is used or needed.

This is the first working release.

What's New in v0.2.1

Search every open tab (#1)

Every word must occur somewhere in a tab by default; a quoted argument is a phrase.

notepad-search raining cats dogs     # tabs containing all three words
notepad-search "cats and dogs"       # a phrase
notepad-search -E 'inv-\d{4}' --any  # regular expressions; --any for any of them
notepad-search -w -s Cat             # whole words, case-sensitive
notepad-search --per paragraph a b   # both words in the same paragraph

Each result shows the window, the tab's first line, and the paragraph around the match with the words highlighted. -A, -B, -C give lines before and after instead, --words N a number of words, -F the whole tab; --json gives the results as data. Exit codes follow grep: 0 on a match, 1 on none, 2 on an error.

Every result says what was not searched. Windows 11 Notepad does not create a tab's text until the tab has been shown, so some tabs cannot be read silently; the last line always says how many tabs were searched and how many were not.

Jump to the window

notepad-search go 2                  # bring result 2's window to the front
notepad-search --go plumber tuesday  # print the results, then jump if exactly one tab matched
notepad-search show 2                # print result 2's whole tab

Tabs Notepad has not loaded

notepad-search --load WORD (or notepad-search load on its own) clicks through the tabs Notepad has not loaded so they can be searched. It always prints a notice and counts down first, because each window comes to the front for a moment and takes the keyboard focus. Set your default with notepad-search config load never|ask|always; --load and --no-load override it for one run. Once loaded, tabs stay loaded until Notepad restarts.

If Notepad taskbar buttons are left red afterwards, notepad-search unflash clears them (again announced: each window comes forward for half a second).

Tidy the desk

notepad-search list                       # every Notepad window and its loaded tabs
notepad-search status                     # count the tabs not loaded yet
notepad-search minimize                   # minimise every Notepad window
notepad-search minimize --except-results  # all but the windows the last search found
notepad-search minimize --except 3 12     # all but windows 3 and 12

minimize never moves the keyboard focus.

Private by default

Between runs notepad-search keeps only window and tab handles and each matching tab's length, so go N and show N work. No search words, window titles, tab text or hashes of the text are stored. A search history is kept only if you turn it on (notepad-search config history 20). notepad-search forget deletes everything it saved (it asks first; --yes skips the question).

Every on/off option has both forms, --x and --no-x, so a default set in the config can always be overridden for one run.

Known issues

  • After a loading pass, an auto-hiding taskbar may stay visible with no button highlighted; restarting Explorer clears it.
  • The default load = ask counts every window's tabs on each search, which takes several seconds on a desktop with many windows; --no-load (or config load never) skips it.

Installation

pip install notepad-search

From source:

git clone https://github.com/DazzleTools/notepad-search.git
cd notepad-search
pip install -e ".[dev]"

Version History (0.2.x)

Version Key Change
v0.2.1 Current -- first published release: v0.2.0's tool, plus traffic tracking and a platform-support page
v0.2.0 First working version (tagged, not published separately)

Platform Support

Platform Status
Windows 11 with the new Notepad (tabs) Tested on one desktop with 95 windows and 179 tabs
Windows 10 / classic Notepad Not read yet (why)
macOS, Linux Not supported (Notepad is Windows-only)

Requirements

  • Windows 11
  • Python 3.11 or newer
  • Installed automatically: pywin32, pywinauto, psutil, dazzle-lib, dazzle-filekit

Related

notepad-cleanup saves open Notepad tabs to disk and organises them; each tool installs and works on its own.