When I run the following script from command line,
Needs["JLink`"]; ConnectToFrontEnd; resultChart = UseFrontEnd[JuliaSetPlot[0.365 - 0.37 I]]; UseFrontEnd[Export["test.png", resultChart]]; CloseFrontEnd;
the graphic file gets written out fine. In fact, the calls to
ConnectToFrontEnd, UseFrontEnd, CloseFrontEnd are not even necessary.
However, if I call this script from Windows task scheduler, the function
ConnectToFrontEnd returns True, but then an error is returned:
Rasterize::type : Notebook[ -- omitted --] cannot be rasterized.