TaskPaper 3 has a new scripting interface.
If you show us the source code of the TP2 script(s) that failed, we may be able to adapt it/them.
A couple of other relevant threads: