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