Executes an Obsidian command just like you'd do manually using its command palette.
Important: Due to the way Shortcuts and Obsidian work together, with Actions for Obsidian as translator in-between, AFO needs to maintain an internal list of commands available in your vault(s). So before you can use this action, the list needs to be fetched at least once using the "Get Available Commands" action. See below.
How to use it
As mentioned, AFO needs to know the list of available commands in order to let you select from it via its "Obsidian Command" parameter. So prepare two workflows, one for getting the list of commands from Obsidian and which is run occasionally and only when necessary, and another one for executing one or more commands from the list.
Workflow 1 (Getting the list):
- "Get Available Commands" action. Set "Vault" to your vault.
Run it once.
Workflow 2 (Executing commands):
- "Trigger Command" action. Select a command from the list.
The Shortcuts workflow editor will get the list of commands from AFO when the action is initialized, which happens when you add a "Trigger Command" action to the workflow, and also (later on) when you re-open the workflow in the editor. The action will not be updated on list changes while it is open in the editor, though. (I wish I could work around that but at the time of this writing, I've yet to find a way.)
For example, when you have the two workflows from section "How to use it" open in the editor, side by side, the command list in Workflow 2's action will show whatever it contained at the time of the action's initialization in the editor. Running Workflow 1 will not change that, since the Shortcuts editor will not update the Trigger action in Workflow 2 with the new data. Only closing and re-opening Workflow 2 in the editor will do the trick.
Changes / History
- Initial release.