Skip to content

Cannot read calendar with applescript #3803

@noahfraiture

Description

@noahfraiture

Hello,

I'm trying to make a module to read the event in apple calendars starting with MEET to add a google meet link to them. However impossible to read the calendar with apple script and hammerspoon never request permissions.

local ok, result = hs.osascript.applescript([[
    tell application "Calendar"
        return count of calendars
    end tell
]])
print("OK:", ok, "Result:", result)

This request will return false and nil but it will request control permission after reset org.hammerspoon.Hammerspoon. So it ask for permission, but still fails. This command works in the script app of course.

local ok, result = hs.osascript.applescript([[
    tell application "Calendar"
        activate
        return "Hello mom"
    end tell
]])
print("OK:", ok, "Result:", result)

But this request will works ! It will focus the app and return Hello mom.

All that seems to be a permission problem that hammerspoon never ask for. The permission asked for control will not show up in "Privacy & Security" as other app like ghostty do

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions