I've been using my MacBook with AC power a lot lately and I thought that if I could use pmset to run on AC power whenever available and keep my battery at roughly 50% that would extend the life of my battery and AC adapter. I know that it's advisable to regularly drain and recharge the battery.
I'm running OS X 10.10, Yosemite, on a mid-2012 Macbook Pro. I read that in Mac OS X 10.6 pmset could be used to prevent the battery from charging.
Is there any way to do this other than putting a piece of tape on the charger?