System will emit a NSBeep sound when `getSelectedText()` report error.
When the extension calls Raycast's getSelectedText() Api and uses try-catch to catch the error, the system will emit a NSBeep sound if it cannot get the selected text from the foremost app
Raycast version: 1.33.2
Description
Steps To Reproduce
export const fetchItemInput = async () => {
try {
await getSelectedText();
} catch (e) {
console.error(String(e));
}
};
- Implement and call the above function in the extension.
- When there is no window on the desktop, open the extension and call the above function, the system will emit NSBeep sound.
- The actual trigger for this bug is that the selected text cannot be retrieved from the top window.
That is, when
getSelectedText()reports an error, it makes a sound. The following errors were caught:Error: Cannot copy selected text from frontmost application.
Another very similar api,getSelectedItem, does not make a sound when an error is reported
The current behavior
System will emit a NSBeep sound when getSelectedText() report error.
The expected behavior
System will not emit a NSBeep sound when getSelectedText() report error.
Is this fixed?
Hi @mathieudutour 👋 I just tested it and found no fix, but I couldn't see Raycast's idea of fixing it for a long time, and the bug didn't affect the actual use, so I chose to close it
we do want to fix it, we didn't get to it yet. I'll reopen it