Ok.... It only does it with the a/c on? Does it feel like it's chugging and then al of a sudden it idels up fast and then smoothes out? If that's the case then I'm pretty sure that your cooling fan is inoperative. The a/c compressor comes on and the head pressure builds too high, the engine lugs down and the compressor turns off. I'd bet that the a/c also doesn't work real good at idle? It's also probably intermittent?
A dollar to a doughnut that's what the problem is.