We’ve provided a couple of tips to help you prevent your Mac from going to sleep when you don’t want to, from a time-based app called Sleep No More to some Terminal magic that can do something similar. Unfortunately, both solutions are based on time. What if you want to keep your Mac from sleeping while it’s running a specific app, no matter how long it takes?
Free Mac app, Wimoweh, may be your answer. Check it out..