Skip to content

[Apple Notes] get-note-content and update-note time out when Notes.app is not already running #25708

Closed

Description

@jasondk

Extension

https://www.raycast.com/raycast/apple-notes

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

  1. Quit Notes.app
  2. Ask the AI to read a note's content
  3. get-note-content calls getNoteBody() → runAppleScript() with default 10s timeout
  4. Notes.app begins launching but doesn't finish within 10 seconds
  5. 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.

Activity

  1. added
    bug
    extension
    on Feb 22, 2026
  2. added theissue type on Feb 22, 2026
  3. added
    extension: apple-notes
    on Feb 22, 2026
  4. raycastbot commented on Feb 22, 2026

    @raycastbot
    Collaborator

    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-notes can trigger bot actions by commenting:

    • @raycastbot close this issue Closes the issue.
    • @raycastbot close as not planned Closes the issue as not planned.
    • @raycastbot close as duplicate Closes the issue as duplicate.
    • @raycastbot rename this issue to "Awesome new title" Renames the issue.
    • @raycastbot reopen this issue Reopens the issue.
    • @raycastbot assign me Assigns yourself to the issue.
    • @raycastbot good first issue Adds the "Good first issue" label to the issue.
    • @raycastbot keep this issue open Make sure the issue won't go stale and will be kept open by the bot.
  5. 0xdhrv commented on May 7, 2026

    @0xdhrv
    Member

    Closed with #25720

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugextensionextension: apple-notes

    Type

    Fields

    Priority

    None yet

    Severity

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions