I was playing around with WolframScript last night (Windows 10, standard native command line). I really like it, but I did run into a problem: If I execute code on the cloud servers, exported files end up in my cloud directory. Is there a way to export to a local directory instead? I'm probably missing something very obvious since this was my first attempt with WolframScript.
Here's my example: The script file:
#!wolframscript
Export["testplot.png",Graphics3D[Sphere[]]];
Print[AbsoluteFileName["testplot.png"]];
And here's the behaviour for both a local kernel and a cloud kernel:
(I realize I can get the image to my dropbox with the Services framework, but I'm more concerned about the general case where the local directory could be anywhere on my computer.)
By the way, the following example from the Documentation doesn't work for me; it simply produces a broken image file (Windows problem, maybe?):
wolframscript -code 'Graphics3D[Sphere[ ]]' -format PNG > file.png
Anyway, this example leads me to believe that redirecting output is the preferred method, as opposed to using Export
in the script file itself; is that correct? (The output file is saved locally regardless of whether I use the -cloud
option.) But even if I get the example to work, what if I need multiple exports from the same script?