Use this code to apply Divide Effect. Please note that the effect must be applied to groups.
to group selected items, use
to apply the Divide effect to a selected group, use
app.executeMenuCommand('Live Pathfinder Divide');
if you need to expand appearance, use
Elmentary you can not. Tough you can kludge your way trough the system and call a action that has been recorded to use pathfinder. The scripting interface of Illustrator is pretty limited in scope.
The extendscript that comes with Adobe apps can not call the windowing subsystem to press buttons. NodeJS could be made to do that tough but then that wouldnt be a simple script.