openclaw - 💡(How to fix) Fix [Bug]: mac-calendar skill: AppleScript queries miss iCloud-synced events on headless Mac servers [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63142Fetched 2026-04-09 07:57:53
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
renamed ×1

Fix Action

Fix / Workaround

Workarounds attempted

Code Example

tell application "Calendar"
     set startDate to date "2026年4月10日 00:00:00"
     set endDate to date "2026年4月10日 23:59:59"
     tell calendar "课程"
       set evList to events where start date >= startDate and start date <= endDate
       -- returns nothing even though events exist in Calendar UI
     end tell
   end tell
RAW_BUFFERClick to expand / collapse

Problem

When the mac-calendar skill runs AppleScript queries against the local Calendar app, events that exist in iCloud-synced calendars (visible in the Calendar app UI) are not returned by the script queries. This happens specifically on headless Mac servers where Calendar data may not be fully synced from iCloud.

Steps to reproduce

  1. Have a headless Mac server running OpenClaw
  2. Calendar app is signed into iCloud with calendars containing events
  3. Events are visible in Calendar app UI but AppleScript queries return empty/incomplete results
  4. Example query that misses events:
    tell application "Calendar"
      set startDate to date "2026年4月10日 00:00:00"
      set endDate to date "2026年4月10日 23:59:59"
      tell calendar "课程"
        set evList to events where start date >= startDate and start date <= endDate
        -- returns nothing even though events exist in Calendar UI
      end tell
    end tell

Expected behavior

AppleScript queries should return all events visible in the Calendar app, including iCloud-synced events.

Environment

  • Headless Mac (M4)
  • macOS Calendar app signed into iCloud
  • Events visible in Calendar UI but not returned by script queries
  • Calendar sync appears incomplete on the server

Workarounds attempted

  • Opening Calendar app manually does not fix the issue
  • Querying all calendars with every calendar still misses events
  • The events appear to exist only in iCloud, not in the local Calendar cache

Suggested fix

Consider alternative approaches for mac-calendar access:

  1. Use calendarserver command-line tool if available
  2. Query iCloud calendar data directly from ~/Library/Application Support/iCloud/Accounts/
  3. Add a note to the skill documentation about iCloud sync requirements for headless Mac servers
  4. Consider adding a calendarcloud sync or similar command to force iCloud sync before querying

extent analysis

TL;DR

Consider using alternative approaches for accessing mac-calendar data, such as the calendarserver command-line tool or querying iCloud calendar data directly, to resolve the issue of missing events in AppleScript queries on headless Mac servers.

Guidance

  • Investigate the use of the calendarserver command-line tool as a potential replacement for AppleScript queries to access calendar data.
  • Explore querying iCloud calendar data directly from ~/Library/Application Support/iCloud/Accounts/ to retrieve events not available through AppleScript.
  • Verify that the Calendar app is properly synced with iCloud by checking the sync status and ensuring that events are visible in the Calendar UI.
  • Consider adding a calendarcloud sync or similar command to force iCloud sync before querying calendar data to ensure that all events are available.

Example

-- Potential alternative approach using calendarserver command-line tool
-- (Note: This is a hypothetical example and may require modification)
do shell script "/usr/bin/calendarserver list-events --calendar='课程' --start='2026-04-10 00:00:00' --end='2026-04-10 23:59:59'"

Notes

The provided AppleScript query may not work as expected due to the incomplete sync of Calendar data from iCloud on headless Mac servers. The suggested fixes and workarounds aim to provide alternative approaches for accessing calendar data, but may require further modification and testing to ensure compatibility and effectiveness.

Recommendation

Apply workaround: Use alternative approaches for accessing mac-calendar data, such as the calendarserver command-line tool or querying iCloud calendar data directly, to resolve the issue of missing events in AppleScript queries on headless Mac servers. This approach allows for more direct access to calendar data and can help mitigate the issue of incomplete sync on headless Mac servers.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

AppleScript queries should return all events visible in the Calendar app, including iCloud-synced events.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING