Hook sync between two Mac machines

I am having some difficulties syncing the hook links between two Mac machines. Basically I move the whole Hook/ folder to iCloud drive, thinking that if both machines share the same cloud drive, then they can share the notes and also using hooksync links as well.

So I created a markdown document and linked it to a website in machine A. Then I ensure that the Hook app in both machines are referring to the same hooksync directory and activated them, also both machines refer to the same hook notes directory.

Unfortunately, when I open the same Markdown document in machine B, I am unable to see the linked website.

Here is the catch: Machine A’s user has a different username compare to Machine B. But I created a symlink in Machine B as /Users/MachineAUserName to point to /Users/MachineBUserName.

Previously I was testing this with Dropbox (the Hook folder under Dropbox) - but the dropbox folder paths are quite different in both machines, so I switched to iCloud drive, which should be the same in both machines, i.e. /Users/X/Library/Mobile Document/…

Any advice or help would be much appreciated.

Thanks in advance.

Is it the same Apple ID signed into iCloud on both machines? I’d expect that’s mandatory.

I also think symlinking between users will be problematic. There will be permissions issues.

Yes, both machines were signed in with the same Apple ID, only the local usernames are different.

Hi, zhaokoh.

  1. do you see the links go into the chosen iCloud folder on each Mac that has Hook links?
  2. have you checked that the files are syncing via iCloud? The sync is predicated on the data in the folder syncing via whatever sync mechanism is used. Is iCloud behaving well for you irrespective of Hook?

the paths don’t need to be the same. Each Hook instance merely looks at the folder in the macOS account in which it is running. Hook itself has no model of where the folder originates from, or whether the folder’s content is synced by any particular service. For all Hook knows, there could be two Hook instances running on the same Mac sharing the same sync folder; or there might be multiple folders synced through rsync or any other sync folder.

Hook does not sync preferences (such as sync folder paths). Its notion of syncing is merely

  1. writing link data to a particular folder,
  2. reading from that folder,
  3. merging link data from that folder

Hook’s Syncing only deals with links, it does not share the content of the Hook folder: notes, templates, Hook files. I’ve updated the Sync Tab help page to make that clear.

The Notes directory can be anywhere on your Mac. And after a note file is created, you can move those files anywhere on your various Macs. So Hook notes are not “owned” by Hook.

You can turn on the macOS iCloud preference to save the Desktop and Documents folder if you choose. (Many people don’t like it, however.)

one more thing: (as noted elsewhere on forum and doc) there’s an issue right now such that if a Macbook is not plugged in, Hook sync will not run. (We set the priority of the Hook sync background process too low.) That will be fixed in the next release of Hook.

Thank you so much @LucB for your responses and information about Hook. While troubleshooting yesterday, I checked the hooksync folder in both machines and it seems they are identical (timestamp and number of files). I think I must have set things up incorrectly. I will troubleshoot further.

@LucB, in my situation, say I have a file called machine1.md which I stored at machine1 under /Volumes/Data/Dropbox/Document/ (which is a Dropbox folder). I linked this file machine1.md to a website using Hook. Activate my hooksync under /Volumes/Data/Dropbox/hooksync.

Then in machine 2, I have my dropbox folder under /Users/Zhao/Dropbox/Document/ (note different dropbox path here). So, I will get machine1.md synced automatically (since it was synced by Dropbox). And I think machine2 will get the links that I made in machine 1 under /Users/Zhao/Dropbox/hooksync.

So if I open machine1.md in machine 2, will Hook show me the website link that I made in machine1? I would expect it will but I am having difficulty making this works at the moment.

Is my understanding correct?

In principle, this should work with the caveats expressed in Using Hook with Dropbox – Hook. When a file is renamed or moved in Dropbox, on the local host, Dropbox actually moves the original file into one of its hidden directories and then creates a new file. If Dropbox does this while Hook is aware of a link to the moved file, it might not compensate for Dropbox’s move. So the website will end up pointing to a file in a Dropbox cache folder which Dropbox may purge at its will. If however the file was moved from one folder in Dropbox to another in Dropbox before Hook has tracked the file (e.g., Hook sync hasn’t been enabled on its side), then Hook should be able to attach the bidirectional link to the (presumably) desired file, based on its partial (terminal) path information, assuming the terminal file names are the same (which is what Hook would use as a heuristic in this case).

We’re looking to add additional heuristics to Hook for Dropbox’s syncing idiosyncrasies.