Send links to locally mounted dropbox files in mac mail

Hello,


I work with a group that shares files via dropbox. We all have dropbox locally mounted like so:

/Users/hughwelles/Dropbox/Folder/file.txt


I would like to send emails to people using mac mail that include links to their locally mounted dropbox files, specifically not to open the dropbox folder in a web browser.


I've tried to include the following in the "add link" function of mail:


/Users/$USER/Dropbox/Folder/file.txt


but mail will not accept this as a link. I also read that including "file://" as a prefix works, but not for me.


Last, I've tried in the finder to navigate this way to a folder again using the $USER path variable in the "Go to Folder" function, but this only opens the /Users/ and goes no further.


****@Hughs-MacBook-Pro ~ % echo $USER
**** 

in the terminal gives my correct username, so I'm not sure what's happening here nor how I can get mac to do what I'm looking for.


Any thoughts?


Thanks





[Personal Information Edited by Moderator]


MacBook Pro 13″, OS X 10.11

Posted on Oct 14, 2021 6:40 AM

Reply
Question marked as ⚠️ Top-ranking reply

Posted on Oct 14, 2021 9:42 AM

Finder is very clever with spaces and you DON'T need to escape them.


Also, don't use a file URI, just the path, and it will work, e.g.


Select


~/Desktop


and control-click, Show in Finder will open a window to your Desktop:


Similar questions

12 replies
Sort By: 
Question marked as ⚠️ Top-ranking reply

Oct 14, 2021 9:42 AM in response to Hugh Welles

Finder is very clever with spaces and you DON'T need to escape them.


Also, don't use a file URI, just the path, and it will work, e.g.


Select


~/Desktop


and control-click, Show in Finder will open a window to your Desktop:


Reply

Oct 14, 2021 7:43 AM in response to Hugh Welles


No, you CAN'T do that. And there is no reason why you would do it.



The only way to share content directly from your mac drive is to:


1) Run some sort of server - like a web server, sftp server...

2) Give people outside access - this depends on where they are: on the same place, like a home or work network, or scattered in different locations?

If you are using your mac in your home network, you need to:

a) get a domain name

b) have that domain point to the IP address of your router

c) Configure your router to route access to, say, port 22 or port 80 from the outside to your local mac IP address.


I am thinking that you may be way over your head with all of this.

If you have little or no idea of what I am talking about, then I strongly recommend that you stick to sharing the dropbox links.

Reply

Oct 14, 2021 8:33 AM in response to Hugh Welles

The $USER environment variable is exposed in the Terminal (UNIX command-line) but is not available to Cocoa applications, unless they have been specifically written to obtain it via the Objective-C/Swift NSUserDefaults Class methods. The use of the FILE URI (file:///) is also doomed in Apple Mail because it is not a URL URI (http:// or https://).

Reply

Oct 14, 2021 9:01 AM in response to Luis Sequeira1

You misunderstand, I am not proposing to run a file server from my own laptop. The files are on Dropbox's server. Each user mounts them locally as follows:


/Users/Jamie/Dropbox/Folder1/FileA.txt

/Users/Bess/Dropbox/Folder1/FileA.txt


These two paths relate to where each dropbox user mounts FileA.txt on their own laptop. I am looking for a link/path that the Finder can use which will insert "Jamie" when issued on Jamie's computer and "Bess" when issued on Bess's computer. In the terminal, this path would just be: "/Users/$USER/Dropbox/Folder1/FileA.txt". This way one path can be shared in an email that relates the the mount point of FileA.txt for each user (assuming Dropbox has been mounted in the user's home folder, which it almost certainly is for everyone at the company).

Reply

Oct 14, 2021 9:12 AM in response to VikingOSX

Ok, that I understand. Is there a variable in the finder that relates to the username?


Update: I realized from your post that I had left off the third '/' of 'file:///'. In fact you can insert a link using the FILE URI in mail. Now I've run into a permissions issue.


If use file:///Users/hugh as a test, I can right click on the link and hit open with>Finder(default), I get the error "Mail" does not have permissions to open "hugh" (my home folder). Even if I give mail full disk access in System Preferences>Security & Privacy>Privacy>Full Disk Access menu, I still get the permissions error.


Judging by ls-l, "group" and "other" have read permission:

hugh***@Hughs-MacBook-Pro /Users % ls -lh
total 0
drwxr-xr-x+ 36 hugh***     staff   1.1K Oct 14 09:22 hughwelles
Reply

Oct 14, 2021 9:06 AM in response to Hugh Welles

Thanks for clarifying.

You can perfectly well write


~/Dropbox/Folder1/FileA.txt


The tilde will be interpreted as the home folder in each case.


For example, in the Finder you can press Command-Shift-G and paste that line above, and in each case, regardless of the user, it will show you that file selected in the respective folder.


Reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Send links to locally mounted dropbox files in mac mail

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.