This page describes the Anki Script default command syntax.
All command parameters may be quoted using either single or double quotes.
...
If quotes are present the outermost ones are removed, so
'value'
and value
are equivalent.
When a command parameter specifies a list of values the items in the list are separated using a comma, and
each item is stripped of the outermost quotes like for single values. So, for example, , so
'value1', 'value2'
and value1,value2
are equivalent.
Blank lines
Lines consisting only of whitespace are ignored.
Comments
#
Lines starting with '#' are comments.
#----------------------------
# install required addins
#----------------------------
Display message
display message: {message}
This command displays a message to the user.
display message: adding verb data
Open help page
open {name} help page
This command opens one of the addon's help pages.
open main help page
A help page name of 'main' can be used to refer to 'index.html'.
For ad-hoc scripts, or if the addon did not specify a location for help pages, the command is ignored.
Perform menu action
click {name} menu item
This command performs a menu action
click "Courses.Anki Script example custom syntax.Verb Aspects" menu item
A dot '.' is used to separate sub-menus.
Set alias value
set {name} alias, asking {prompt}, with default {default}
Install addon
install addin {id} ({name})
This command installs an addon from AnkiWeb.
install addin 1984823157 (Audio Files)
If the addon has already been installed this command is ignored.
The user is prompted to agree with the installation. The id must be the addon id shown on the
AnkiWeb site, and the 'Help' button on the
confirmation dialog is linked to the addin's AnkiWeb page.
The name should be the name that Anki uses for the addon.
Configure an addon
configure {name} addin
Partially configure an addon
configure {name} addin, setting key {key}
Copy a single file
copy {name} from {source} to {destination}
Create multiple decks
create decks {decks}
This command creates multiple decks.
create decks verbs, nouns
Create a single decks
create deck {deck}
This command creates a single deck.
create deck verbs
Add note
add {model} note, setting fields {fields}
Set fields values for an existing note
for {model} {note} set fields {fields}
This command sets multiple field values for an existing note.
for verb думать set fields:
Russian (я) to думаю,
Russian (ты) to думаешь,
Russian (он/она/оно) to думает,
Russian (мы) to думаем,
Russian (вы) to думаете,
Russian (они) to думают
Set a field value for an existing note
for {model} {note} set field {field} to {value}
Change the default deck for a card template
set default deck to {deck} for {model} card type {template}
This command changes the default deck for a single card template.
set default deck to vocabulary for pronoun card type e>r (nom, m)
Note that the card template is referred to by its name, not position.
Change the default deck for multiple card templates
set default deck to {deck} for {model} card types {templates}
This command changes the default deck for a multiple card templates.
set default deck to vocabulary for pronoun card types e>r (nom, m), r>e (nom, m)
Note that the card templates are referred to by their name, not position.
Create a new note type
create {model} note type and {commands}
This command creates a new note type.
create verb note type and:
add fields Russian, Audio, English;
add card types e>r, r>e, setting default deck to verbs
This command must have at least one sub-command as at least one field and one card template must
be defined for the note type.
Create a new cloze note type
create {model} cloze type and {commands}
This command creates a new cloze note type.
create declension cloze type and add fields Russian, English
This command must have at least one sub-command as at least one field must be defined for the
note type. Note that as Anki automatically creates card templates for cloze note types no card
templates can be added.
Edit a new note type
change {model} note type and {commands}
There may be multiple sub-commands, separated by a semi-colon ';' and for readability they may be placed on
a new line.
The sub-commands used when creating or changing note types are:
Define parameters
with {parameters}
Translate parameters
translate {name} to [{values}]
Add new field
add field {field}
Add a new field to the note type.
change verb note type and:
add field Aspect;
Add new fields
add fields {field}
Add new fields to the note type.
change verb note type and:
add fields Aspect, Pair;
Add new card template
add card type {template}, setting default deck to {deck}
Add new card templates
add card types {templates}, setting default deck to {deck}
Edit card template definition
change card type {template}