I'd like to create/copy local hyperlinks to local files and/or folders, so that the clickable text directly takes me to that file/folder on my local system.
How can I do that on macOS?
How can I do that on macOS?
EDIT: OK, so if I add the file::///stuff, I think it works, but the App in question complains:I don't know the context of your hyperlinks, but wouldn't a URL like this work?
file://localhost/path/to/filename
or
file:///path/to/filename
Possibly...but the To Do app, has a free-text box associated with each task. I'd simply like to add local hyperlinks to relevant documents/folders associated with each task. As I said, I can add a hyperlink to a website (such as a Dropbox repository) there fine and the link is clickable and works (launching Safari). But links to local folders appear to be blocked due to permissions...a rather frustrating (and unnecessary) limitation!I think you're trying to use particular apps to do something that they're really not set up to do.…and I get it.
However, you might need to think about some other method (third-party app) to achieve your goal.
CloudKit is designed for manageability, flexibility, and power. By organizing apps in containers, CloudKit ensures each app is siloed so its data won’t get entangled with other apps.
/Users/id/Library/CloudStorage/Dropbox/myfilename.doc
Thanks for the ideas!Totally wild grasp at straws here, but might be a number of things going on.
As @BrianBaughn mentioned, app might be not really setup to do that. It's a cloud-y application, so a link to a local file makes little sense if using the app on a mobile device or different computer via browser.
Another thing is that Dropbox has been moving their user's file stores to use Apple CloudKit framework. I have not dug deep into what one can/can't do when the files are there, but it does mess up things that might have worked in the past. For example, I had a login LaunchAgent to clean out old backups I made and stored in Dropbox, and once the Dropbox folder was moved under CloudKit, permission problems started to pop-up.
Catalina supports CloudKit and what might be happening in the case of Dropbox cannot be seen by MS To Do:
If the Dropbox folder is under CloudKit, can maybe try a more fully qualified pathname, but guessing that might not work either due to above. So,/Users/id/Library/CloudStorage/Dropbox/myfilename.doc
No option to open any file...From "Microsoft To Do" open any file on the desktop (File - open or whatever the menu is). That should give it the necessary permission.
Yeah - many thanks for the idea. I wish it worked this way...I don't have Microsoft To Do, my suggestion is based on Apple's documentation:
"The user implicitly grants your app access to a file in the Desktop folder when selecting the file in an Open or Save panel, dragging it onto your app, or opening it in Finder. Your app can access that file right away and any time in the future. In addition, if your app creates a new file in the Desktop folder, the app can access that file without user consent."
https://developer.apple.com/documen...property_list/nsdesktopfolderusagedescription
Thanks for investigating. I Attaching is a fall-back option - and the one that ToDo seems to want you to do...but I've realised that editing an attached file only modifies the local attachment, not the one synced via ToDo itself. So, again, this is pointless.I was not suggesting to add attachments, just Apple’s ways of granting permission for the Desktop folder.
But macOS permissions are a mess. If you add the file as attachment and remove it, the link for the file works...until you close Microsoft To Do.
I have SIP disabled and I granted Microsoft To Do permission for the Desktop folder. The link still doesn’t work.
Video:
View attachment 2172585
Fantastic! It works! I also added a hotkey:Not ideal, but here is a solution:
Automator – New – Quick Action – Workflow receives current – text in Microsoft To Do
In the left Library search for Run Shell Script and drag it into the workflow, choose Pass input as arguments, instead of echo, write open. Save and close, go to System Settings – Keyboard – Shortcuts – Services – in the Text section you will find the created Quick Action and you can assign a shortcut, like ⌘⇧O.
Now, when you select the text /Users/user/Desktop/TextFile.txt in Microsoft To Do, you can press the shortcut and the file will open.
View attachment 2172858
tell application "Finder"
set theLink to POSIX path of (selection as string)
set the clipboard to theLink
end tell
It won't open ~/Dropbox for some reason. But in any case, the more user friendly solution would be if the script itself truncated the text prior to Dropbox/... Not sure if that is possible..."Open Finder Items" Automator action can open both ~/Desktop/Text file.txt and /Users/user/Desktop/Text file.txt
View attachment 2173689
Much appreciated! I'll look into this option. I'll also see if it is possible in the bash script itself.You want to have /Users/Auser/Dropbox/some file.txt written in Microsoft To Do and the script to open ~/Dropbox/some file.txt ?
That can probably be done in AppleScript. Apple has some examples on Manipulating Text, including how to remove whitespace around text
https://developer.apple.com/library...cAutomationScriptingGuide/ManipulateText.html