Triggering an Obsidian command from within an event callback

My goal is to effectively execute the ‘navigateBack’ command from within the ‘file-open’ event listener in my plugin on certain files. The goal is to make it as if I had never triggered the load of that file at all (just for certain files.)

It would be great to be able to trigger an arbitrary obsidian command from within any callback function, still I will take any solutions no matter how hacky.

NOTE: This is my first plugin. I am so impressed that somehow you guys have written these complex plugins! There are no real docs it seems, it is all is just coding by grepping source code. I am very impressed!

Thanks for the help

SOLVED:

In line 11,776 of the QuickAdd plugin we see the ‘executeCommandById’ method:

   this.app.commands.executeCommandById('app:open-settings');

And this command does what one would expect… it runs the names command.
Wow, what a crazy way to code! I cannot wait for the plug-in API to be released…
(I didn’t find this method listed in any of the unofficial docs that I looked at)