USE THIS LINK provided by LCGuy. It is exactly what you need.
If you hot-wire the power supply, like what was said earlier and in this link, this bypasses the battery problem. You will have to manually switch on/off or pull the cord to turn the mac on and off.