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