Export map as obj on run time

I have the Runtime import/ export plugin and i want to export the map as obj when i press a button.