Repository navigation
Description
Extension
Raycast Version
1.104.6
OS Version
26.2
Description
getNoteBody() and setNoteBody() in api/applescript.ts call runAppleScript() without specifying a timeout. The default in @raycast/utils is 10 seconds (10,000ms). When Notes.app is not already running, the AppleScript tell application "Notes" triggers an app launch, which can easily exceed 10 seconds.
The resulting error message is:
Error: Command timed out after undefined milliseconds: osascript
(The "undefined" is a cosmetic bug in @raycast/utils error reporting — options?.timeout is undefined because no options were passed, even though the actual timeout used was 10s.)
Suggested Fix
Pass an explicit timeout to runAppleScript in getNoteBody and setNoteBody:
export async function getNoteBody(id: string) {
return runAppleScript(
`
tell application "Notes"
set theNote to note id "${escapeDoubleQuotes(id)}"
return body of theNote
end tell
`,
{ timeout: 30000 },
);
}
export async function setNoteBody(id: string, body: string) {
return runAppleScript(
`
tell application "Notes"
set theNote to note id "${escapeDoubleQuotes(id)}"
set body of theNote to "${escapeDoubleQuotes(body)}"
end tell
`,
{ timeout: 30000 },
);
}30 seconds provides enough headroom for Notes.app to launch, while still failing reasonably quickly if something is actually wrong.
Note: The "timed out after undefined milliseconds" phrasing in the error message is a separate minor bug in @raycast/utils — it reads options?.timeout for the error string, but when no options are passed, the timeout is applied internally as a default without being set on the options object.
Steps To Reproduce
- Quit Notes.app
- Ask the AI to read a note's content
get-note-contentcallsgetNoteBody()→runAppleScript()with default 10s timeout- Notes.app begins launching but doesn't finish within 10 seconds
- Timeout error
Current Behaviour
When Notes.app is not already running, get-note-content and update-note fail with:
Error: Command timed out after undefined milliseconds: osascript
The error occurs because the default 10-second timeout in @raycast/utils is too short for Notes.app to launch. The "undefined milliseconds" phrasing is a secondary cosmetic bug caused by the timeout not being explicitly set in the options object passed to runAppleScript.
Expected Behaviour
get-note-content and update-note should work reliably whether or not Notes.app is already running. With an explicit 30-second timeout passed to runAppleScript, Notes.app has sufficient time to launch and respond to the AppleScript command.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Severity
Activity
raycastbot commentedon Feb 22, 2026
Thank you for opening this issue!
🔔 @tumispro @ron-myers @mathieudutour @StevenRCE0 @SKaplanOfficial @tylerwince @xilopaint @ridemountainpig @teemusuvinen @saldanaj97 @andreaselia @fanhefeng @charlesharries you might want to have a look.
💡 Author and Contributors commands
The author and contributors of
raycast/apple-notescan trigger bot actions by commenting:@raycastbot close this issueCloses the issue.@raycastbot close as not plannedCloses the issue as not planned.@raycastbot close as duplicateCloses the issue as duplicate.@raycastbot rename this issue to "Awesome new title"Renames the issue.@raycastbot reopen this issueReopens the issue.@raycastbot assign meAssigns yourself to the issue.@raycastbot good first issueAdds the "Good first issue" label to the issue.@raycastbot keep this issue openMake sure the issue won't go stale and will be kept open by the bot.0xdhrv commentedon May 7, 2026
Closed with #25720