Automating the creation of deep links to iCloud Files on macOS

I’m looking for a faster way to generate links to files in iCloud, so that I can rapidly return to them. Using these links is the perfect way to call up files in a platform-neutral way, for example, by creating a list in Apple Notes of the PDFs that you need for meeting, so that you can just click on the link when you need it. But creating a link involves a huge number of steps, involving option/right-clicking on a file in Finder, then Share > Add People, then setting a bunch of settings for sharing and, finally, clicking on “Copy Link”, at which point you have what you need: a URL that can also be accessed from iOS. Any ideas on how to automate this?

(BTW this is partly sparked by considering the terrific new Hook app but then realizing that the links it generates don’t work for iOS. That’s not going to work for me, since I’m trying to go iPad-only when I’m out of the house and so what I’m looking for are links that work across macOS, iPadOS, and iOS. The links can be generated, but it’s such a slog to create them! Basically, what I’m looking for is a way to create something like what Box or Dropbox offers: a quick way of generating a link to a file, but then in iCloud Drive.)

Hey Joel,

just stumbled over your post while searching for exactly that functionality albeit for a different reason.

When receipts on my Mac enter the filesystem Hazel adds a ToDo item in Things so I’ll actually have a look at it. The ToDo includes, for example, a file:///Users/dennis/Documents/archive/receipts/2019-12-12-my-receipt.pdf link which works fine on my Mac.

But it would be even cooler to replace it with a link like so I could check the receipt on my iPhone.

Have you made any progress on creating this kind of links? I searched the web extensively but did not come up with a solution. All this clicking just can’t be the solution, right?