Skip to content

windows_explorer

This directory integrates the Windows Explorer application and standard Windows File Browser dialogs (e.g., Save, Open, Browse) with Talon's voice-controlled navigation and file management ecosystem.

Overview

The integration consists of two main files that work together to map abstract file-system actions—like creating a folder, retrieving the current directory path, or opening a terminal—into the precise keyboard shortcuts and Windows-specific API interactions required to control the OS.

  • windows_explorer.py — Defines the application scope, normalizes OneDrive and user paths, and implements cross-platform file-manager actions.
  • windows_explorer.talon — Activates standard navigation tags and defines specialized voice commands for quick folder jumping.

How It Works

1. Application Detection

The Python script defines two distinct application scopes: * windows_explorer: Matches active instances of standard Windows Explorer (by process name explorer.exe or application name). * windows_file_browser: Matches Windows system-wide file interaction windows, such as "Save As", "Open", "Browse", and "Select" dialogs.

Both environments share the same user actions and context mapping.

2. Path Mapping and OneDrive Normalization

In Windows Explorer, the window title often displays the name of the current folder (e.g., "Desktop" or "Documents") rather than its absolute path. To retrieve the exact absolute path of the directory you are viewing, windows_explorer.py performs several normalization steps:

  • OneDrive Detection: It dynamically checks if OneDrive is active and mapping common user directories (Desktop, Documents, Pictures). If detected, it redirects those titles to their OneDrive subfolders; otherwise, it resolves them directly to the local user profile.
  • Windows API Integration: Using Python's ctypes library, it queries the Windows security API (GetUserNameExW) to fetch the active user's display name, allowing the script to correctly map a window titled with the user's name to their local home folder (C:\Users\<Username>).
  • System Exclusions: Titles that do not represent physical file directories—such as "Task Switching", "This PC", and "Run"—are explicitly ignored.

3. Native File Manager Actions

Talon's generic file-manager actions are mapped to native Windows Explorer hotkeys:

  • Navigation: Opens parent directories via Alt + Up, and navigates directly to paths by focusing the address bar (Ctrl + L), typing the path, and pressing Enter.
  • Item Creation & Interaction: Emulates Ctrl + Shift + N to trigger a new folder creation, Alt + Enter to display file properties, and types filenames to select or open them.
  • Terminal Integration: The action file_manager_terminal_here activates the path bar, types cmd.exe, and runs it, immediately spinning up a command prompt at your current directory.

4. Commands and Interface Tags

By loading windows_explorer.talon, Talon enables the following core capabilities:

  • Tags: Activates the user.address, user.file_manager, and user.navigation tags, bringing in community-wide standard voice commands for file manipulation.
  • Quick Jumps: Adds quick-navigation shortcuts to go directly to Windows environment folders:
    • go app data: Jumps to %AppData%
    • go program files: Jumps to %ProgramFiles%