Applescript for CLI (command line tool)

I’d like to have a command in Terminal that takes a list (or glob) of files, linking them all together. So running hook file1.md file2.md ../maindoc.pdf would effectively create bi-directional hooks on all three files. I see in the AS dictionary how to get a bookmark from the file path, but I don’t see a way to actually create the hook using that bookmark. Am I missing something?

3 Likes

thanks for asking, @ttscoff. Hooking things together is not yet in the AppleScript dictionary, but it is something we plan to add.

3 Likes

+1 for this idea. Would love to see this added. I’ve been watching Hook develop and have a license but have not used it much (yet).

This is interesting. I’m a little unclear. Which outcome are you expecting? A or B or C or something else?

1 Like

Still playing with the idea, but my inclination is to treat it like a cp command, where everything before the final argument is a source, and the final is the destination. So A, in that case. It did occur to me that bidirectional linking should be a consideration, I just didn’t take it any further without knowing if it was going to be possible at all :).

1 Like

Why not see it as ln -s a b. So basically you have a directed link pointing from b to a. It’s only partly an analogy, as for ln, b would be created at this point. But OPs requirement could then be realised with a couple of such calls.

That’s in Hook 1.6, released yesterday :slight_smile: (release notes).