Dropbox link that opens in Finder

I want a way to send someone a link to a shared file in Dropbox, but it would open in their Finder instead of the web.

Working with a team, our files are already sync'd, but there are a TON of folders, and I want to be able to link them right to the file in Finder.

This may be a Dropbox-specific solution which is fine, and may require them to set up something first in KM (saving their Dropbox folder in a variable).

Any thoughts welcome.
Thanks

I'm imagining a custom link structure that can fill in the file path as an argument to a variable that is the local Dropbox location, thereby ignoring the computer-specific directory hierarchy and just looking at our individual Dropbox folders as the root

Assuming that you and all on your team has the default DropBox install location, you should be able to just provide them with a POSIX path like this:
~/Dropbox/SomeFolder/SomeFile.txt

It would be easy to write a Macro and/or script to get the path of the current file selected in the Finder, and convert it from an absolute path to a user relative path. It could then put the path on the clipboard, or with a bit more work, create a new email compose window, and paste into the body.

Let us know if you need more help. If you do need help be sure to tell us what mail client and macOS you are using.

Thank you!

We're using Slack to communicate, so simply putting it in the clipboard would suffice.

Going with your idea... I think it'll work, although since I have two computers with different Dropbox locations, the macro would have to translate incoming links based on my computer's Name (e.g. nrightnour's MacBook Pro), and on my co-worker's computer, be able to translate links from either of my computers' file structures with no user input. Should be possible.

My file paths:
[Computer A]
/Volumes/Nova/

[Computer B]
/Users/myname/

Coworker's Filepaths
/Users/hisname/

Not quite sure how to do this type of thing in KM. Any help would be appreciated.

Thanks again!

One approach would be to create a SymLink on each Mac that does NOT use the DropBox standard location if ~/Dropbox. So the SymLink file would be:

  • Named "Dropbox"
  • Stored in the user's home folder
  • Points to the actual Dropbox folder.

Then "~/Dropbox" should work for everyone, since the tilde (~) represents the user's home folder.
If Slack (or other app, like email) does NOT auto-convert the path to an actual link, then you will need to create a KM Macro to select the path, and use the "Open File in Default App", OR "Reveal File", whichever you prefer.

Make sense?

2 Likes

Brilliant tip.

I ended up getting this working - and the symbolic link made it so I could distribute a single macro to anyone who had the link setup, since nothing depended on the local machine.

Thanks again.

The only thing that would make this better is if I didn't have to program the other people's Dropbox locations into the macro, so that it was completely computer-agnostic.

Right now, in order to delete the user-specific directories, I have to check against all the possible Dropbox locations for all the computers – KM needs to know where Dropbox is located on the sender's computer in order to know how many charcters to delete from the pathname.

Only then can I prepend ~/Dropbox/ to the pathname, and reveal it in Finder.

Why do you need to do this if all members of your team have created a SymLink to the DropBox folder?

No you don't. Just use a KM RegEx search and replace.

Let us know if this works for you.

Here's an example:

(Note: This was written in KM9d8 Beta. KM9 Should be Released very soon. But you can easily convert it to KM8)

MACRO:   Prompt For Dropbox File & Replace Start of Path with Tilde [Example]

Example Output

image

**Requires: KM 9+   macOS 10.11 (El Capitan)+**
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

#### DOWNLOAD Macro File:
<a class="attachment" href="/uploads/default/original/3X/a/7/a7a9e543c7781ca0bbeaa4ce628c6e5eefd4774a.kmmacros">Prompt For Dropbox File & Replace Start of Path with Tilde [Example].kmmacros</a>
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**




---



<img src="/uploads/default/original/3X/d/b/db92fb6a3a3e0a279c1225c747e0230bf7138a5c.png" width="526" height="917">
1 Like

Got it working!

I had a feeling regular expressions might be good for this! But I've never used them before, and would have been completely lost without your example, so thank you.

I looked up the ICU Regular Expressions so I see how you did it. KM keeps getting better and better.

Excited for KM9.

Thanks again
Nathan