Is it possible to calculate atomic contribution to pDOS automatically, through a script or code?

I have scripted to run several calculations (Idea is to run around ca 1000) different calculations of A3B structure. This script is finished, but I would liek to extract the atomic contribution of element A and B to the full pDOS information. This can be done by selecting the wanted atoms and then vbisualizing pDOS in the GUI. But this is of course too cumbersome to do for so many calculations. 

Is there any script to do this? Or someone that can help me do this? (Considering that this possibility exists in the GUI, the code is already there... Can I e.g. create a table of atoms that Im interested in and then do calculate pDOS on those?)