Skip to content

Cross-platform support: macOS TextEdit and Linux text editors #2

@djdarcy

Description

@djdarcy

Summary

Investigate cross-platform support for extracting text from default text editors on macOS (TextEdit) and Linux (various editors).

Context

The current implementation is Windows 11 Notepad-specific, using:

  • win32gui / win32con for window enumeration and WM_GETTEXT
  • pywinauto UIA backend for tab discovery and switching
  • Windows-specific APIs (RichEditD2DPT, NotepadTextBox class names)

Platform Assessment

macOS — TextEdit (Medium difficulty)

  • Accessibility API: pyobjc + macOS Accessibility framework
  • Window enumeration: NSWorkspace or CGWindowListCopyWindowInfo
  • Text extraction: Accessibility API AXValue attribute on text areas
  • Tab support: TextEdit doesn't use tabs — each document is a separate window
  • Challenge: Accessibility permissions required (System Preferences → Privacy)

Linux (Hard — fragmented)

  • Desktop environments: GNOME (gedit/Text Editor), KDE (Kate/KWrite), XFCE (Mousepad)
  • Accessibility: AT-SPI2 (Assistive Technology Service Provider Interface)
  • Window enumeration: wmctrl, xdotool, or Wayland equivalents
  • Challenge: Each editor has different internals; no single "Notepad equivalent"
  • Likely approach: Focus on GNOME Text Editor as the closest equivalent

Proposed Architecture

  • Abstract the platform-specific extraction behind an interface
  • discovery.py → platform-specific implementations
  • extractor.py → platform-specific read methods
  • CLI and organizer remain platform-agnostic

Tasks

  • Define extraction interface (discover windows, count tabs, read text)
  • Spike: macOS TextEdit extraction via pyobjc
  • Spike: Linux GNOME Text Editor extraction via AT-SPI2
  • Refactor discovery.py and extractor.py into platform backends

Analysis

See 2026-02-13__22-34-00__non-obtrusive-tab-extraction-analysis.md for the original extraction approach analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions