Skip to content

notepad

The community/apps/notepad directory contains the Talon files for controlling the Windows Notepad application.

The file notepad.talon defines the application tag, app: notepad, which is used to activate the context defined in notepad.py. It also tags the context with user.tabs and user.find_and_replace. These tags enable other user-defined features that are associated with these tags, including tab management and the find-and-replace UI.

The file notepad.py sets up the Talon context for the Notepad application. It defines the application using the mod.apps.notepad setting, which is matched on Windows when app.exe is notepad.exe. The context uses ctx.matches to match the app: notepad tag, and then defines a win_actions class. The filename() function extracts the filename from the window title, returning an empty string if there is no filename (i.e. it's a new, unsaved file).