---
title: "Discussion on \"7 macOS details behind an AI dictation app written in Rust\" | Hashnode"
description: "Discussion on \"7 macOS details behind an AI dictation app written in Rust\". Lowspeak is an open-source menu bar app for AI speech-to-text in every Mac app: hold fn, talk, let go, and the text appears at the cursor. It transcribes online with Groq (free on Groq's free tier wit"
url: "https://hashnode.com/posts/7-macos-details-behind-an-ai-dictation-app-written-in-rust/6aef933d481964c3ff3498ab"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [7 macOS details behind an AI dictation app written in Rust](https://sventmueller.hashnode.dev/7-macos-details-behind-an-ai-dictation-app-written-in-rust?utm_source=hashnode&utm_medium=feed)

Lowspeak is an open-source menu bar app for AI speech-to-text in every Mac app: hold fn, talk, let go, and the text appears at the cursor. It transcribes online with Groq (free on Groq's free tier wit

Nov 7 · 6 min read · sventmueller.hashnode.dev  
Read the article

-   [#rust](https://hashnode.com/tag/rust)
-   [#macos](https://hashnode.com/tag/macos)
-   [#opensource](https://hashnode.com/tag/opensource)

## Written by

[Sven Müller](https://hashnode.com/@sventmueller)

@sventmueller · Munich, Germany

  
[View profile](https://hashnode.com/@sventmueller)

## Responses 4

Markdown supported · ⌘↵ to post

[c-wind](https://hashnode.com/@c-wind)

[Nov 9](https://hashnode.com/posts/7-macos-details-behind-an-ai-dictation-app-written-in-rust/6aef933d481964c3ff3498ab/comment/6af1c5a92fd6f53decc0a530)

The clipboard handoff is a great detail: waiting for the target app to read the promised pasteboard item, then checking the change count before restoring the old contents, avoids overwriting a newer clipboard update. And stripping trailing line breaks is a thoughtful last guard for terminal dictation.

[Apps by Mo](https://hashnode.com/@appsbymo)

[Nov 8](https://hashnode.com/posts/7-macos-details-behind-an-ai-dictation-app-written-in-rust/6aef933d481964c3ff3498ab/comment/6af0755b176028e3a1368089)

The promised pasteboard item is a nice way to know when the target app has read the text. One more detail from my own work on typing into other apps: in Safari, Mail and other WebKit views, setting AXValue on a text field returns success, but the text can land in whichever field has the page’s focus, and reading the field back can still report the new value. What held up for me was setting AXFocused, waiting until the app’s focused element really is that field, typing, then reading back. Also, WebKit builds a page’s accessibility tree on the first query, so a window that looks nearly empty is worth reading a second time.

[Sven Müller](https://hashnode.com/@sventmueller)

[Nov 8](https://hashnode.com/posts/7-macos-details-behind-an-ai-dictation-app-written-in-rust/6aef933d481964c3ff3498ab/comment/6af0755b176028e3a1368089#reply-6af08f3875fe089e5c1e2a1e)

Thanks, that's a useful one. Lowspeak doesn't touch AXValue at all: it promises the text on the clipboard and sends ⌘V, so the target app inserts it at its own caret, the same way as a paste by hand. The flip side is a weaker version of what you describe: Lowspeak knows which app is in front, not which field. Since 1.0.5 it remembers the app that was in front when you pressed fn; if another app is in front once the text is ready, it leaves the text on the clipboard with a notice instead of pasting. If nothing reads the clipboard, the old content comes back after 10 seconds.

The point about WebKit building the tree on the first query is good to know. If per-field targeting ever comes in, that's where I'd start.

[Apps by Mo](https://hashnode.com/@appsbymo)

[Nov 8](https://hashnode.com/posts/7-macos-details-behind-an-ai-dictation-app-written-in-rust/6aef933d481964c3ff3498ab/comment/6af0755b176028e3a1368089#reply-6af0bdd6dab0eeb4bb70f062)

That makes sense. Pasting with Cmd+V lets each app insert at its own caret, so the WebKit quirks never come up. Thanks for writing it up, the promised pasteboard trick was new to me.
