You won’t be able to use scripting to export the E field distribution directly from visualizer. You would need to use the plot/image commands that generate 1D/2D plots. These script commands open up the figure windows. You can export the figure from the windows using the exportfigure command.
Please refer to the following links for more information on these commands: