Skip to content

stata

This directory provides Talon integration for Stata, a statistical software package, specifically tailoring support for Windows environments and the built-in Stata Do-file Editor.

It consists of two main components that define the application context and expose voice commands to streamline executing statistical code.

Component Overview

Application Definition and Language Context

The stata.py file registers Stata within Talon's application registry. It targets Windows installations by matching the process name statase-64.exe or the application name Stata.

Additionally, it configures Talon's code intelligence context so that when Stata is active, Talon recognizes the active programming language as "stata". This allows other language-specific syntax or vocabulary modules in a user's configuration to activate automatically.

Do-File Editor Commands

The stata_do_file_editor.talon file provides voice commands scoped to the Windows version of the Stata Do-file Editor (identified by the window title starting with Do-file Editor).

These commands orchestrate editor actions and keyboard shortcuts to run segments of code:

  • Running code: Voice commands like "do this" map directly to the native Ctrl+D shortcut, which executes the current selection in Stata.
  • Line-based execution: "do line" automates selecting the entire current line before executing it.
  • Bulk execution: "do (all | file)", "do way up", and "do way down" automate complex selection behaviors (such as selecting everything from the cursor to the top or bottom of the document) and copy-execute sequences to run larger blocks of code effortlessly.

How They Work Together

  1. Detection: When you switch to Stata on Windows, stata.py matches the application and sets the language context to "stata".
  2. Scope Matching: If you focus the Do-file Editor sub-window, the title matcher in stata_do_file_editor.talon matches the active window.
  3. Command Execution: You can then use voice commands to rapidly execute lines or blocks of Stata code without needing to use a mouse or manual selection shortcuts.