WIP: new script API