Talon accessibility - Experimental Talon integrations using macOS accessibility APIs

Overview

talon_accessibility

Experimental Talon integrations using macOS accessibility APIs.

Features

  • menu: support for creating actions that directly run menu commands
  • window_close: support for closing application windows (the current one, everything but the current one, or everything -- even for apps that are not focused!)
  • window_doc: revealing the current file/directory in Finder ("document reveal"), opening it ("document open"), or copying its path ("document copy path")
Comments
  • dictation_context: use talon.ui import to fix running on windows

    dictation_context: use talon.ui import to fix running on windows

    Per Slack discussion with aegis, talon.ui.mac shouldn't imported from it all, we should import use the platform independent version instead.

    Specifically, the mac package fails to raise ImportError properly:

    2022-04-04 15:04:10 ERROR user.talon_axkit.dictation.dictation_context (C:\Users\nriley\AppData\Roaming\talon\user\talon_axkit\dictation\dictation_context.py) import failed
       15:                                    threading.py:930* # loader thread
       14:                                    threading.py:973*
       13:                                    threading.py:910*
       12:                         app\resources\loader.py:887|
       11:                         app\resources\loader.py:823|
       10:                         app\resources\loader.py:641|
        9:                         app\resources\loader.py:677|
        8:                         app\resources\loader.py:731|
        7:                         app\resources\loader.py:427| # [stack splice]
        6:                           importlib\__init__.py:127|
        5:                         app\resources\loader.py:248|
        4:                         app\resources\loader.py:243|
        3: user\talon_axkit\dictation\dictation_context.py:9  | from talon.mac.ui import Element
        2:                         app\resources\loader.py:361|
        1:                                 talon\mac\ui.py:29 |
    AttributeError: 'Library' object has no attribute 'tl_mac_has_separate_spaces'
    
    opened by phillco 10
  • all: reformat Talon using `talonfmt`

    all: reformat Talon using `talonfmt`

    Similar to https://github.com/knausj85/knausj_talon/pull/947, let's use talonfmt, although I prefer a slightly longer maximum line length.

    Note that one change to notification.talon is working around a parser issue: https://github.com/wenkokke/talonfmt/issues/17

    opened by phillco 3
  • dictation_context: check setting before attempting to grab current element

    dictation_context: check setting before attempting to grab current element

    Context: https://talonvoice.slack.com/archives/G8J6HDR6C/p1658803696161089

    Grabbing the current element can raise an exception if it doesn't exist, so we should probably test the setting first.

    opened by phillco 2
  • accessibility dictation: first round

    accessibility dictation: first round

    No rush on reviewing this! I figured it would be good to get your thoughts on this first batch of changes, before I go on to push more stuff. I'm probably going to focus on cursorless-on-JetBrains for the rest of the weekend so I'm not blocked on this review.

    In this change:

    • using AX to acquire context for dictation formatters
    • APIs for overriding in specific apps, a sample override for Messages.app
    • the ability to automatically enable AX for Electron
    • basic debugging of accessibility using hissing

    My thought is the experimental branch can be a sort of middle ground between main and our feature branches. Ambitious beta testers could use it and it also gives us a place to merge our development changes together and test them together. We can promote it to main afterwards.

    opened by phillco 2
  • Use latest talonfmt

    Use latest talonfmt

    opened by wenkokke 1
  • pre-commit: use shed to format Python opinionatedly

    pre-commit: use shed to format Python opinionatedly

    Taking a good suggestion from https://github.com/knausj85/knausj_talon/issues/666, let's set up shed to reformat our code in an opinionated fashion. It also sorts imports and removes unused imports, which was my main motivation. :)

    This doesn't set up any enforcement yet -- I need to learn more about how to use GitHub Actions (will do that later). For now, let's just make sure we run pre-commit run at some point during development, or use pre-commit install to install the commit hook.

    Also if we forget I'll just reformat and pushed directly to main/experimental, it's not a big deal. Just want to get alignment on the actual style.

    This just adds the config to reduce merge conflicts between the two branches -- to see what it looks like in action, see https://github.com/phillco/talon_axkit/pull/11.

    opened by phillco 1
  • dictation_peek_left: update method signature

    dictation_peek_left: update method signature

    Clobber was removed in https://github.com/knausj85/knausj_talon/pull/915, so without this change axkit this throws a type error after merging past that knausj version:

    talon.scripting.types.ActionImplError: Function 'user.dictation_peek_left' incompatible with prototype 'user.dictation_peek_left'
      Signature: (clobber=False)
      Expected:  () -> Optional[str]
      - Parameter count mismatch. Found 1, expected 0
    

    Note that I think this means that users must merge this axkit commit and that knausj commit at the same time.

    opened by phillco 0
  • pre-commit: add flynt

    pre-commit: add flynt

    Flynt converts older versions of string interpolation to f-strings.

    Since we plan to also use it in knausj, let's add it here too for beta testing. Although we don't have any old-style strings to fix up, so there were no changes applied.

    I also ran pre-commit autoupdate which upgraded https://github.com/pre-commit/pre-commit-hooks.

    opened by phillco 0
  • pre-commit: add prettier

    pre-commit: add prettier

    One last reformatter. This adds prettier which supports a wide variety of languages.

    Here, we'll use it for our Markdown and YAML files (hence the large diff, since it reformats pre-commit-config.yaml itself.)

    opened by phillco 0
  • [pre-commit.ci] pre-commit autoupdate

    [pre-commit.ci] pre-commit autoupdate

    opened by pre-commit-ci[bot] 0
  • Issue with navigation commands

    Issue with navigation commands

    Mike on Slack:

    I think I may have found a bug in axkit. I earlier reported that dictation mode wasn't replacing text correctly. It seems to be related to axkit. If I install axkit and then issue the following voice commands in dictation mode in TextEdit (on MacOS):

    1. The quick brown fox jumps over the lazy dog
    2. navigate up select phrase brown 3 orange

    I always get:

    The quick orange fox jumps over the lazy dog

    Note the extra space before the word "orange".

    However, if I remove axkit, restart Talon, and execute the same commands, I don't get the extra space. I can also see that something different is happening when Talon replaces the text without axkit. The cursor moves around in a different way depending on whether axkit is installed or not.

    opened by phillco 0
  • dictation:

    dictation: "resume with"

    This allows you to quickly make edits in the current input buffer, by saying "resume with".

    resume with <existing phrase in buffer> <new replacement>

    Example

    https://youtu.be/aU_B4KMl-DM?t=28

    The person dictates My favorite dinner is squid vomit soup then says resume with dinner is chicken cacciatore to end up with the final sentence of My favorite dinner is chicken cacciatore.

    dictation idea dragon feature 
    opened by phillco 0
  • custom accessibility inspector

    custom accessibility inspector

    MacOS includes an app called the Accessibility Inspector, which we frequently use during development:

    Screen Shot 2022-03-27 at 2 41 11 PM

    The most useful feature is that you can click the "crosshair" button and then hover over a certain element in a different app to see its attributes.

    While the inspector is nice, it has a few weaknesses:

    • Limited voice control -- it has a couple of keyboard shortcuts but that's it
    • Squats on the alt-space shortcut while running (makes it harder to quickly use).
    • Similarly, if an element is selected it draws a persistent green box around it. Normally this is fine but it makes for observing things long term annoying
    • After using the inspector, you frequently will want to iterate on what you've just inspected using the Talon REPL, but this requires context switch + manually copying information. A first party Talon integration could allow for faster switching.

    Thanks to the new ui.element_at() recently added to talon by aegis, we could build a replacement using Canvas. It could serve as a semitransparent sidebar that could be dragged anywhere and toggled on/off as necessary. It could also draw borders around the focused element and/or elements under the mouse.

    idea 
    opened by phillco 0
  • dictation: consider not grabbing the entire AXValue

    dictation: consider not grabbing the entire AXValue

    At least in some cases you can explicitly request a range, e.g.:

    >>> o.focused_element.children.find_one(AXRole='AXTextArea').AXStringForRange[Span(0, 10)]
    '\n\nNicholas'
    

    This may be more efficient with long documents.

    enhancement dictation 
    opened by nriley 1
Owner
Phil Cohen
Phil Cohen
Python library for Spurwing API to schedule appointments, manage calendars and custom integrations.

Spurwing API Python Library Lightweight Python library for Spurwing's API. Spurwing's API makes it easy to add robust scheduling and booking to your a

Spurwing 1 Jul 14, 2021
Ma2tl - macOS forensic timeline generator using the analysis result DBs of mac apt

ma2tl (mac_apt to timeline) This is a DFIR tool for generating a macOS forensic

Minoru Kobayashi 66 Nov 18, 2022
Experimental bridges between Telegram calls and other platforms.

Bridges by Calls Music Experimental bridges between Telegram calls and other platforms. Current bridges Bridge 1 (YouTube, Twitch, Facebook, etc...) B

Calls Music 14 Oct 8, 2022
WebCash is an experimental new electronic cash ("e-cash") that enables decentralized and instant payments to anyone

Webcash WebCash is an experimental new electronic cash ("e-cash") that enables decentralized and instant payments to anyone, anywhere in the world. Us

Bryan Bishop 24 Dec 11, 2022
Eclipse-grabber - Generate Discord Token Grabbers for both Windows and MacOS

Eclipse Grabber Eclipse Discord Token Grabber What is Eclipse? Eclipse is an ope

Dimitris Kalopisis 117 Dec 23, 2022
Automation application was made by me using Google, Sheet and Slack APIs with Python.

README This application is used to transfer the data in the xlsx document we have to the Google Drive environment and calculate the "total budget" wit

null 3 Apr 12, 2022
TwitterDataStreaming - Twitter data streaming using APIs

Twitter_Data_Streaming Twitter data streaming using APIs Use Case 1: Streaming r

Rita Kushwaha 1 Jan 21, 2022
🐍 The official Python client library for Google's discovery based APIs.

Google API Client This is the Python client library for Google's discovery based APIs. To get started, please see the docs folder. These client librar

Google APIs 6.2k Jan 8, 2023
Actively maintained, pure Python wrapper for the Twitter API. Supports both normal and streaming Twitter APIs.

Twython Twython is a Python library providing an easy way to access Twitter data. Supports Python 3. It's been battle tested by companies, educational

Ryan McGrath 1.9k Jan 2, 2023
The official Python client library for the Kite Connect trading APIs

The Kite Connect API Python client - v3 The official Python client for communicating with the Kite Connect API. Kite Connect is a set of REST-like API

Zerodha Technology 756 Jan 6, 2023
An API Client package to access the APIs for NBA.com

nba_api An API Client package to access the APIs for NBA.com Development Version: v1.1.9 nba_api is an API Client for www.nba.com. This package is mea

Swar Patel 1.4k Jan 1, 2023
:snake: Python SDK to query Scaleway APIs.

Scaleway SDK Python SDK to query Scaleway's APIs. Stable release: Development: Installation The package is available on pip. To install it in a virtua

Scaleway 114 Dec 11, 2022
Python wrapper for the Sportradar APIs ⚽️🏈

Sportradar APIs This is a Python wrapper for the sports APIs provided by Sportradar. You'll need to sign up for an API key to use the service. Sportra

John W. Miller 39 Jan 1, 2023
Python interface to the World Bank Indicators and Climate APIs

wbpy A Python interface to the World Bank Indicators and Climate APIs. Readthedocs Github source World Bank API docs The Indicators API lets you acces

Matt Duck 47 Oct 31, 2022
A collective list of free APIs for use in software and web development.

Public APIs A collective list of free APIs for use in software and web development. A public API for this project can be found here! For information o

null 222.5k Jan 2, 2023
🐍 The official Python client library for Google's discovery based APIs.

Google API Client This is the Python client library for Google's discovery based APIs. To get started, please see the docs folder. These client librar

Google APIs 6.2k Dec 31, 2022
Stop writing scripts to interact with your APIs. Call them as CLIs instead.

Zum Stop writing scripts to interact with your APIs. Call them as CLIs instead. Zum (German word roughly meaning "to the" or "to" depending on the con

Daniel Leal 84 Nov 17, 2022
Die wichtigsten APIs Deutschlands in einem Python Paket.

Deutschland A python package that gives you easy access to the most valuable datasets of Germany. Installation pip install deutschland Geographic data

Bundesstelle für Open Data 921 Jan 8, 2023
Some examples regarding how to use the Twitter APIs for academic research

Twitter Developer Platform: Using Twitter APIs for Academic Research All the scripts require a config.ini file in which the keys are put. There is a t

Federico Bianchi 6 Feb 13, 2022