Microsoft OneDrive Word Document Issues [Solution: quit OneDrive, relaunch the MS App]

After some further investigation, I’ve come to realize that the string returned from Word, PowerPoint and Excel can be changed into a file:/ link format with some AppleScript.

Those strings are alongside this format
https://some.company-my.sharepoint.com/personal/some.user/Documents/ followed by the relative path to the corresponding file.

If we change the first part of the link to the path to OneDrive (such as file:///Users/lucas/OneDrive - Some Company) and keep the relative path, we can reach the local file and have hook link to it just fine.

I’ve wrote a few lines of code to replace those with the path to my OneDrive root folder and now it’s working fine.

Sharepoint folders required with a few other tweaks on the strings, but worked the same.