Thanks for pointing me in that direction, I should have looked at the JS interop capabilities in Max.