Previously, I successfully referenced a file in a Calendar event, by referencing its string URL.
use AppleScript version "2.4"-Yosemite (10.10) or later
use framework "Foundation"
use scripting additions tell application "Finder" to set Finder_Selection to selection as alias
set theURL to current application's |NSURL|'s fileURLWithPath:(POSIX path of Finder_Selection)
--> (NSURL) file:///Users/akim/Desktop/Legion%20of%20Honor%202019-09-01.pdf
Calendar, recently, stopped retaining the path representation. Although it accepted a reference, it removed it after a second or two. Even so, Calendar retained its numerical id such as file:///.file/id=6571367.8766902296, after dragged a file document into a Calendar event window.
How do I correctly AppleScript NSURL’s method to retrieve a file URL ID?