AnkiMobile iOS Shortcut to Add Card

Providing support to “add card from clipboard” action in iOS shortcuts app would be awesome.

How it would work:

  • Capture clipboard/shared text; split at “?”.
  • Assign text before “?” to the first field, after “?” to the second field.
  • Specify deck and card type for shortcut to add cards to in Anki settings; no need to specify field names if question half sent to field 1 and answer sent to field 2.
  • Content must include “?” to be used as Q/A delimiter or all text would be added to field 1 only in the newly created card.

One possible method to implement:

  1. Define custom intent in Intents definition file for card creation.
  2. Implement intent handling: receive text, split at “?”.
  3. Configure input as “text” for magic variables.
  4. Process input: pre-? to field 1, post-? to field 2.
  5. Predefine deck and card type to use when adding cards by shortcut in anki’s app settings.
  6. Use Anki API/database to create card.
  7. Add intent to Info.plist.
  8. Optionally, donate intent usage with INInteraction.
  9. Action appears in Shortcuts app
1 Like

For adding single cards, why doesn’t URL Schemes - AnkiMobile Manual meet your needs?

4 Likes

Never saw this reply. Didn’t know this existed. Wow! Mind blown. Wish I would have checked back sooner. Looks like it will work. Thank you!

2 Likes