How to output variables visible in plot global variables to a file

Original question related to this topic here: how to output field data from paraview (should be easy)