Mesh link all open documents (in Preview, Word, etc.)

This is a Keyboard Maestro macro which mesh Hooks all open documents in a given app (e.g., Preview, Word) by chaining a script by Christopher Stone for getting the POSIX path of an open document (app agnostic) to a script by Brett Terpstra (@ttscoff) for mesh linking a selection of Finder items.

The macro takes a second to bring each open document to the front in order to engage the first script to get the POSIX paths, then it uses the paths to mesh link all the open documents in Hook via Brett’s script. I’ve confirmed this works for Preview and Word. There is probably a more elegant way to do this, but it saves a lot of time getting open documents cross-Hooked!

Macro: Hook Mesh Open Documents