Anki Forums

Change Deck of Cards

Hello guys,

i’m trying to make my own addon, so i want to programmatically change the deck of some cards.
Is this possible and how?

Thanks in advance,
Tobi7

You can use mw.col.set_deck(), passing it a list of card IDs and the ID of the deck:

cids = [1642081338943, ...]
mw.col.set_deck(cids, deck_id)
3 Likes

Sorry but that didn’t work for me, mw..col doesn’t have a method set_deck, but mw.col.decks, does.
So mw.col.decks.setDeck(cids, did) worked for me!

mw.co.set_deck() was introduced in 2.1.36 apparently, and mw.col.decks.setDeck was deprecated

3 Likes