How to call built-in actions like Undo or Pause from the card’s script section?

Sorry i’ve botched the link, it should work now.

Apparently you can also call some python functions via a pycmd function from JS, but i’ve not tried this out. See this other thread. It seems to be more geared towards addons, but maybe you could try using this just from your JS template.

Before investing loads of time in either of these, remember that these are some pretty advanced features which are (probably intentionally) not widely advertised by the developers. There is no guarantee, that these APIs will stay the same in the future, so if you rely on them, your code might break in the future and you might have to rewrite it.

That beeing said, i’ve written some JS templates myself to do some random things which i wanted to have, and it can be a lot of fun :slight_smile: It’s also motivating because you are ‘scratching your own itch’. So by no means feel discouraged by the previous point. Just maybe don’t expect your code to work exactly the same 5 years from now.

Cheers!

2 Likes