automatic export of orders to csv

I need to have orders automatically exported to CSV when they are completed. Is there any way to do this?

I see that there is a manual way to do so but it would be greatly beneficial if this could be automated.