I searched in this forum and they can use Calendar and Hook together. I tried as they said but Hook tells me “No linkable item found in Calendar”.
Here is what I did: select one event and then press Control+H. I think I should have selected the event correctly as in this screenshot (sorry for this dense schedule)
On my Mac, it only requires no more than 10 secs waiting.
What’s your macOS?
Could you please copy the following script and paste it in Script Editor, select a Calendar event, and run the script in Script Editor every 5 secs? Please send us the result.
Thank you
Summary
set sysinfo to system info
set osver to system version of sysinfo
considering numeric strings
set isVenture to osver ≥ "13"
end considering
set defaultsReply to (do shell script "defaults read com.apple.ical SelectedEvents")
set selectedEvents to parseDefaults(defaultsReply)
if selectedEvents = {} then
return
end if
set sEvent to the first item of selectedEvents
if isVenture then
set {eTitle, eventID, calendarID} to sqlQueryVenture(sEvent)
else
set {eTitle, eventID, calendarID} to sqlQuery(sEvent)
end if
tell application "Calendar"
set eventReference to "[" & eTitle & "](ical://" & "eventID=" & eventID & "calendarID=" & calendarID & ")"
end tell
return eventReference
on parseDefaults(resultText)
set localUIDs to {}
set {TID, text item delimiters} to {text item delimiters, quote}
set resultItems to text items of resultText
set text item delimiters to TID
repeat with i from 1 to (count resultItems)
if i mod 2 = 0 then set end of localUIDs to resultItems's item i
end repeat
return localUIDs
end parseDefaults
on sqlQuery(localUID)
local dateString, localUID
if localUID contains "/" then
set {TID, text item delimiters} to {text item delimiters, "/"}
set {dateString, localUID} to text items of localUID
set text item delimiters to TID
end if
set sqlText to "
SELECT DISTINCT zcalendaritem.ztitle AS title,zcalendaritem.zshareduid AS eventID
, znode.zuid as calID
FROM zcalendaritem
JOIN znode
ON znode.z_pk = zcalendaritem.zcalendar
AND zcalendaritem.zlocaluid = '" & localUID & "';"
set sqlPath to POSIX path of (path to library folder from user domain) & "Calendars/Calendar Cache"
set {TID, text item delimiters} to {text item delimiters, "|"}
set {eTitle, eID, cID} to text items of (do shell script "echo " & quoted form of sqlText & " | sqlite3 " & quoted form of sqlPath)
set text item delimiters to TID
return {eTitle, eID, cID}
end sqlQuery
on sqlQueryVenture(localUID)
local dateString, localUID
if localUID contains "/" then
set {TID, text item delimiters} to {text item delimiters, "/"}
set {dateString, localUID} to text items of localUID
set text item delimiters to TID
end if
set sqlPath to POSIX path of (path to library folder from user domain) & "Calendars/Calendar.sqlitedb"
set {TID, text item delimiters} to {text item delimiters, "|"}
set sqlText to "
SELECT DISTINCT calendaritem.summary AS title,calendaritem.unique_identifier AS eventID
, calendaritem.calendar_id as calID
FROM calendaritem
WHERE uuid = '" & localUID & "';"
set {eTitle, eID, cID} to text items of (do shell script "echo " & quoted form of sqlText & " | sqlite3 " & quoted form of sqlPath)
set text item delimiters to TID
return {eTitle, eID, cID}
end sqlQueryVenture
I’m having exactly the same problem, “No linkable item found in Calendar”, even if I wait for a minute. I’m on Sonoma 14.1, Hookmark 6.0.1 Setapp edition, and when I try your script, I get an error message:
error "2023-11-02 12:00:46.337 defaults[87555:3631301]
The domain/default pair of (/Users/USERNAME/Library/Containers/com.apple.ical/Data/Library/Preferences/com.apple.ical, SelectedEvents) does not exist" number 1
> defaults read com.apple.ical SelectedEvents
2023-11-02 22:04:08.145 defaults[94361:3896738]
The domain/default pair of (/Users/USERNAME/Library/Containers/com.apple.ical/Data/Library/Preferences/com.apple.ical, SelectedEvents) does not exist
I’m quite sure it didn’t work before Sonoma either. I switched to the hookmark setapp version some time ago and that wasn’t completely smooth: Is it possible that that’s the cause of the problem? Is there anything I can try to reset?
I have the same issue, but for Hookmark worked with Apple Calendar before and now it does not. I do not know if it is Sonoma or not, but I have upgraded to Sonoma and now Hookmark does not work with Apple Calendar any more. Please help!
Could you please try give Hookmark full disk access in System Settings and see if it resolves the issue? After it works, you may remove this full disk access setting.
Thanks for trying to help! However, I have now done the relevant steps on the support page and it is still not working with Calendar. The error appeared recently, so I am starting to think that it may not be Sonoma after all. I did a recent Hookmark update and after that it randomly asks for giving it access again after reboot. Can that input help you figuring out what the problem may be?
I turned on full disk access for hook and it works. But after I remove hook from full disk access, it fails again. I would accept giving hook full disk access as a temporary solution. Thanks a lot.