Anki workflow with hook?

Hi, I am a definite newbie to hook, long time user of Anki which I use for spaced repetition. Unfortunately Anki does not have an Applescript dictionary to easily integrate with Hook, but I was hoping to understand how others may be using hook with Anki?

Right now, I am stuck and using each separately and individually which is not ideal.
Has anyone found a good workflow they would be willing to share?

Thanks
Tom

Hook provides a coherent interface to creating links to a variety of local (and remote) resources.

As far as I am aware, the Anki URL scheme doesn’t provide for links to Anki cards (though it can be used to automate the creation of new cards).

But if you want links from your cards, then Hook may make it a bit easier to create links to some of your local resources.

Hi Rob

Hooks ability to link INTO its cards is unfortunate. I was also exploring using the unique ID hook provides as another possible way of circumventing the lack of schema To anki cards, however, as far as I can tell, Anki does not lend itself to spotlight search either.

At this point, it appears you can only link Anki -> external. Although I do not program, I have looked for scripts (applescripts or javascripts) that may be used. I have not found any. I am not even sure Anki has opened itself to allow for this sort of integration.

Best,
Tom

I love the Anki flashcard app. I use Anki for iOS daily. What could be more fun than programming one’s mind? :slight_smile:

Now that copy/paste between Mac and iOS works so well (Copy and paste between devices from your Mac - Apple Support), that’s almost the only way in which I now add content to, and retrieve content from, Anki for iOS. (I don’t use its sync service, but I occasionally sync via iTunes.) E.g., I copy content from a PDF on my Mac and paste it into Anki for iOS; I create questions/answers in nvUltra and copy them (on Mac), and then paste them into Anki iOS. So, I hardly launch Anki for macOS anymore. (But there are some times when I find the macOS version useful).

(Not that I do much editing on iOS. Almost all my content creation happens on macOS. I use iOS for less interactive activities, like practicing; and for dictating notes while I’m away from my Mac.)

I also use Hook’s copy URL function (or Copy Markdown Link) and then paste links into Anki for iOS cards (references to source material). Sometimes the URLs are to the web sometimes to other places (even PDF files on my Mac).

If I want to reference an Anki note from a file on my Mac, I generate unique IDs, and I paste them into the Mac file and into the Anki for iOS note. When I need the info, I copy the ID and use Anki’s search function to find the Anki note (on Anki for Mac or more likely Anki for iOS).

(I do something similar with 1password. 1password does not have a “copy URL” function that I know of. So, to identify a 1password entry, I generate a unique ID on my Mac and paste it into the 1password entry. I paste the same ID (as a reference) in my Mac notes. In my notes, I might write “See 1p/#Q69Y7” which I know means “search for Q69Y7 in 1password”, or just 1p/#Q69Y7 which I know [in my system] means the same thing. When I need to get to the 1password entry, I can copy/paste (or type) the “unique” ID into 1password search field. And of course, I sometimes paste links garnered from Hook directly into 1password items. That’s not as fast as using Hook links would be, but it gets the job done for an app like 1p that does not have the required automation. )

Of course, you don’t need Hook to generate unique IDs. An AppleScript or other tool will do. It just needs to be fast and automatic.

Hook and Anki future?

Anyway, the above is not enough for everyone. Supporting Anki has been on our todo list from the beginning – but I think yours is the first request for it we’ve received apart from myself. If a convenient interface for getting Anki note URLs and names becomes available, we’ll add support. One can develop Anki for macOS plugins. So it might be possible to develop some AppleScript or JavaScript support like @QpUc8K did for InkDrop.

Possibly, but Anki is Python-built and Python scripted, and that would probably be the route to take (calling python through the shell from osascript)

1 Like

At the moment I think the issue is simply that their (python) API is built more around the needs of card creation than around customised run-time interactions with the app.