I want to create a trigger that reads selected text using the standard 'Start speaking' speech
Tried this apple script (Using Blocking and Async options in BTT)
tell application "System Events"
set selectedText to the clipboard
set the clipboard to (the clipboard)
say selectedText using "Alex"
end tell
But it didn't work
Then I asked Claude to generate a shell script
#!/bin/bash
# Get the text from clipboard
selected_text=$(pbpaste)
# Read the text aloud using the default system voice
say "$selected_text"
# Uncomment the line below and comment the line above if you want to specify a voice
# say -v Alex "$selected_text"
And it didn't work either
I also want this to work in platforms like google docs where the standard macos context menu isn't default