Skip to content

finder

This directory provides macOS Finder integration for the Talon voice control system. It defines voice commands, key mappings, and custom Python actions that allow you to seamlessly navigate and control the macOS file manager using your voice.

How It Works

The directory relies on a clean separation of interface and implementation:

  • Voice Commands and Tags: finder.talon activates standard Talon tags such as user.file_manager, user.navigation, user.address, and user.tabs when Finder is the active application. It maps spoken phrases to specific macOS keyboard shortcuts (e.g., switching views, sorting items, and sending files to the trash).
  • System Actions: finder.py implements the backend behavior for the generic user action definitions. It intercepts standard commands (like opening directories, creating folders, or fetching the current file path) and executes them using macOS-specific window title parsing and keyboard simulations.

Key Components

finder.talon

This file targets macOS (os: mac) and the Finder application (app: finder). It contains key mappings for:

  • View Modes: Swiftly switch between icon view (cmd-1), list view (cmd-2), column view (cmd-3), and gallery view (cmd-4).
  • Sorting Options: Voice triggers to sort directory contents by name, kind, size, or date attributes.
  • Navigation & Utilities: Commands to trigger search (cmd-alt-f), access application options (cmd-j), open preferences (cmd-,), or move files to the trash (cmd-backspace).

finder.py

This script overrides the standard user actions to execute macOS-specific tasks:

  • Path Resolution: The file_manager_current_path action reads the active window's title, handles home directory expansions (~), and remaps volumes to properly determine the current working directory.
  • Terminal Integration: The file_manager_terminal_here action uses AppleScript to dynamically fetch the active Finder window's target path and open a new session in the macOS Terminal app pointed directly at that directory.
  • File and Directory Manipulation: Implements actions for standardizing GUI interaction, such as creating new folders (cmd-shift-n), focusing the address bar (cmd-shift-g), and opening specific paths.