Defines whether the command should be enabled or disabled, which in turns affects
the enabled state of any associated button or menu item.
The condition should be expressed as a "when-clause" (as in Visual Studio Code). It's a simple boolean expression that evaluates to
true or false. It supports the following operators:
Operator
Symbol
Example
Equality
==
"editorType == markdown"
Inequality
!=
"currentScreen != config"
Or
||
"noteIsTodo || noteTodoCompleted"
And
&&
"oneNoteSelected && !inConflictFolder"
Currently the supported context variables aren't documented, but you can find the list there:
Defines whether the command should be enabled or disabled, which in turns affects the enabled state of any associated button or menu item.
The condition should be expressed as a "when-clause" (as in Visual Studio Code). It's a simple boolean expression that evaluates to
true
orfalse
. It supports the following operators:Currently the supported context variables aren't documented, but you can find the list there:
https://github.com/laurent22/joplin/blob/dev/ReactNativeClient/lib/services/commands/stateToWhenClauseContext.ts
Note: Commands are enabled by default unless you use this property.