You simply would write a little procedure what does the print job and map it to your "export" button. The print function would check the particle count of your object and iterate through all individual particles and read out the positions and print it to your file. Wouldnt be much more than this few lines
$fileId = fopen "c:/exampleFile.txt" "w";
fprint $fileId("ID PositionX PositionY PositionZ\n");
for($i=0;$i<getAttr particleObject.count;$i++)
{
float $p[] = xform -q -ws -t ("particleObject.pt[" + $i + "]");
fprint $fileId ($i + " " + $p[0] + " " + $p[1] + " " + $p[2] + "\n");
};
fclose $fileId;
You not neccessarily need to make a procedure out of it but it makes it a lot easier when assigning this script to your button.