How to trigger Finder's OneDrive extension's Copy Link action programatically

Hi! I use OneDrive quite extensively on macOS and one thing which I do quite often is copy the OneDrive link of some file into the clipboard, to share with others. Now instead doing this via mouse I would like to by able to do this programmatically via Automator or Alfred.

I tried to play around with AppleScript but couldn’t get it to work. Any idea how this could be accomplished?

1 Like