jackwayneright Posted March 18, 2022 Share Posted March 18, 2022 Hello! I created a workflow that, when the hotkey is pressed, will use the selected text as input, but if nothing is selected, fall back on using the current clipboard as the input. This is accomplished easily enough by passing the selected text to a script and checking if it's empty, and using `pbpaste` if it is. The problem is that with the hotkey node set to use the "Selection in macOS" as the argument, it makes a beeping noise if no text is selected. Is there a way to disable that beeping noise for such a node/workflow? Or, equivalently, is there a way to get the "Selection in macOS" reliably in the same way Alfred does from a script? (Preferably Shell or Python, but I'd make do with any.) Thank you for your time! Alfred 4.6.3 macOS 12.2.1 Link to comment
vitor Posted March 28, 2022 Share Posted March 28, 2022 On 3/18/2022 at 12:27 AM, jackwayneright said: The problem is that with the hotkey node set to use the "Selection in macOS" as the argument, it makes a beeping noise if no text is selected. Is there a way to disable that beeping noise for such a node/workflow? Or, equivalently, is there a way to get the "Selection in macOS" reliably in the same way Alfred does from a script? The sound is coming from macOS, not Alfred. If you press your Hotkey when nothing is selected, you’ll both hear the beep and see the Edit menu of the app you’re in flash. If you press ⌘C in the same situation, you’ll get exactly the same thing. Copying is part of how the feature works. You may still be able to get around it and find some API to get the text selection of apps, but I suspect it will end up being a finickier solution that might not work on non-native apps. Can’t say for sure, as I haven’t researched it. jackwayneright 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now