Here you have a easy script to tell your Mac to shut down.
My one it has three steps.
1. This is a voice that tells me that my Mac will shut down
2. Second I quit all my open applications
3. I tell finder to shut down.
Very easy and very useful because you can even program it in your Calendar.