# why does wolframscript start an instance of Mathematica frontend?

The following wls file surprisingly creates an instance of Mathematica (v12.1) on OS X 10.15.7:

#!/usr/bin/env wolframscript
plato = "Icosahedron";
SetDirectory["./hp-d-wbps-t6-s1-wls/"];

Range2[from_, to_, step_] :=
{#, Length@#} &[
Join[Range[from, to, step], Range[to - step, from + step, -step]]
];

Get["../../../../HyperPlatonics.m"];

Block[
{
full = Range2[.1, 1.5, .01],
viewpoints
},
viewpoints =
Table[
2.9 {2.5 Cos@\[Phi], 2 Sin@\[Phi], .3 Sin@\[Phi]},
{\[Phi], 0, 2 Pi, 2 Pi/(Last[full] - 1)}
];
Map[
Export[
"img" <> IntegerString[# , 10, 6] <> ".jpg",
WarpedBeamedPlatonicSolid[
plato,
3, .9, .7, {5, 5},
First[full][[#]],
ViewVector -> {viewpoints[[#]], {0, 0, 0}},
ViewVertical -> {0, 0, 1},
ViewAngle -> 35 Degree,
ImageSize -> Large
]
] &,
Range[Last@full]
]
];


Why does this happen? Any chance to suppress this behavior?

• "Any chance to suppress this behavior?" I don't think so, but why do you want to suppress it? If you ask about the actual problem that the FE is causing, there may be a solution. As for exporting graphics without the FE—that is not possible. Jan 20, 2021 at 15:57
• @Szabolcs: "exporting graphics without FE not possible" answers the question - tnx 1m
– rlj
Jan 20, 2021 at 16:03
• I'm not 100% clear about what exactly the FE is required for. Converting a Graphics[...] to a bitmap definitely relies on the FE (this is your case). However, if you already have a bitmap, you can export that without the FE. Technically, it's not the exporting but rasterization/rendering that needs the FE. Jan 20, 2021 at 17:32

• Would the function UsingFrontEnd help in this case? Jan 20, 2021 at 16:18