windows_explorer
The community/apps/windows_explorer
directory contains files for controlling Windows Explorer and file dialogs using Talon.
The most important files in this directory are:
-
windows_explorer.py
: This file contains the core logic for interacting with Windows Explorer and file dialogs. It defines a Talon module that matches thewindows_explorer
andwindows_file_browser
apps using their names and executable paths. It also defines a context that matches those apps to the user actions that will be available in those contexts. Most of the interesting logic is in theUserActions
class, which defines the following user actions:file_manager_open_parent()
: Navigates to the parent directory by sendingalt-up
.file_manager_current_path()
: Returns the current path by getting the title of the active window. It also handles remapping some common directories like "Desktop", "Documents", etc to their full path, and excluding some titles such as "Run", "Task Switching", etc.file_manager_terminal_here()
: Opens a command prompt in the current directory by sendingctrl-l
to focus the address bar, insertingcmd.exe
, and pressing enter.file_manager_show_properties()
: Opens the properties dialog for the selected file or folder by sendingalt-enter
.file_manager_open_directory(path: str)
: Opens the specified directory by focusing the address bar usingctrl-l
, inserting the path, and pressing enter.file_manager_select_directory(path: str)
: Selects the directory by inserting the path.file_manager_new_folder(name: str)
: Creates a new folder by sendingctrl-shift-n
, then inserts the specified name.file_manager_open_file(path: str)
: Opens the specified file by inserting the path, and pressing enter.file_manager_select_file(path: str)
: Selects the file by inserting the path.file_manager_open_volume(volume: str)
: Opens the specified volume by callingfile_manager_open_directory
.address_focus()
: Focuses the address bar by sendingctrl-l
.address_copy_address()
: Copies the address bar content by focusing it withctrl-l
and then copying the content to the clipboard withctrl-c
.address_navigate(address: str)
: Navigates to the specified address by callingfile_manager_open_directory
.
-
windows_explorer.talon
: This file defines the Talon commands that trigger the user actions defined inwindows_explorer.py
. It activates theuser.address
,user.file_manager
, anduser.navigation
tags. It also defines some example commands such asgo <user.letter>
which opens a drive volume,go app data
which opens the%AppData%
directory andgo program files
which opens the%programfiles%
directory.
These files work together to provide a set of voice commands for navigating and interacting with Windows Explorer and file dialogs. The python file handles the main logic while the talon file provides the commands that use the python logic.