System will emit a NSBeep sound when `getSelectedText()` report error.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.8k
- Forks
- 6.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 442
Description
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, whengetSelectedText()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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided getSelectedText() example when no desktop window is available, and compare its behavior with getSelectedItem(). Trace the getSelectedText() API path that handles the reported error. Done means the error is still catchable without emitting an NSBeep sound.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100