We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [scripting]

For questions about Wolfram Language Scripts (formerly known as Mathematica Script), or running the kernel without direct user interaction.

76 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
0answers
208 views

Wolfram Script Console Doesn't Close Automatically on Windows

I'm not exactly sure how Wolfram Scripts are supposed to work. So I wrote a simple one to configure MaTeX for me so that all I have to do is double click it on a system where I've installed ...
6
votes
0answers
165 views

Passing UTF-8 to wolframscript on the command line

I am trying to use Unicode input to wolframscript -c, like so: $ ./wolframscript -c '1/∞' â^(-1) The source of this behavior ...
5
votes
0answers
68 views

Detect if running in a script

Is there a reliable way to detect if the current code is running within a script? Note that there are multiple ways to run a script, such as ...
5
votes
0answers
67 views

Processor Detection Problem with Mathematica in Linux command-line

Here is the problem, there are two ways to launch Mathematica in Linux: Double click a notebook file in Desktop (GUI mode). It gives: $ProcessorCount (* 4 *) ...
5
votes
0answers
294 views

WL and WLS textformatting

I am really happy with the new wls (Wolfram Language Script) files. I somewhat abuse the file format, I use them instead of the regular Notebook files. The advantage is that they do not store the ...
5
votes
0answers
176 views

Lisp Interpreter

What is the cleanest way to build a lisp interpreter inside Mathematica. I'm not looking for all the functions to be implemented but instead just the basic syntax.
4
votes
0answers
87 views

Using an existing local kernel when launching from command line

I am trying to setup a web interface to a couple of Mathematica scripts, which in itself is quite simple: ...
4
votes
0answers
58 views

Feedback for my autosave-script

last evening Mathematica crashed and hours of work were gone, because I forgot to save my notebook. During homework today I just pressed Ctrl+S every few minutes, to make sure that I don't loose my ...
4
votes
0answers
112 views

Wrapper for mathematica code with GUI

I have a code written in Mathematica. What I am trying to do is to write a wrapper (say using Python) that will take user input for the Mathematica code, run the code, and create output. I do not ...
4
votes
0answers
151 views

Can one combine Mathematica with bash script?

For example, I create a Mathematica nb file which can work on a set of parameter values or several files at once. It needs me to change the parameter after finishing computing one parameter. If I ...
4
votes
0answers
183 views

MathKernel with `-noprompt` hangs indefinitely when converting simple TeX expression

If I enter MathKernel -noprompt -run 'ToExpression["1", TeXForm]; Exit[]' the kernel hangs, apparently while running TeX.exe ...
4
votes
0answers
270 views

How to batch run Mathematica code from Python?

I have this notebook: ...
4
votes
0answers
295 views

Accessing MathematicaScript over ssh/network

Here is the conundrum I am faced with. I have two computer. One with Mathematica (and hence MathematicaScript) but generally poor resources. The other without ...
3
votes
0answers
37 views

How to automatic close the Command window when a wolframescript is end of operation?

I have generated a .wls file in Mathematica 11. A command window will appear when the .wls runs, but the command window will ...
3
votes
0answers
74 views

Not getting any output from mathematica script

I am completely new, so this question may be trivial, but I can't find any answers in the Wolfram documentation. I am playing around with scripting in Mathematica, but I cannot seem to get any type ...
3
votes
0answers
158 views

Command line arguments to wolframscript interact strangely with -file option

In order to avoid script-defined command-line arguments clashing with existing arguments to wolframscript, it appears you are supposed to use the ...
3
votes
0answers
63 views

Launching kernels… freezes

I'm running a Mathematica script on a remote machine (via ssh connection). I log on the machine and I execute math -script algorithm.m and this message appears ...
3
votes
0answers
133 views

Wolfram Script doesn't even start when there is no internet connection

I wrote a Wolfram Script, and I tried it when there was no internet connection. It couldn't run at all. I tried it many times. PacletInstall::dwnld: An error occurred downloading paclet ...
3
votes
0answers
203 views

About the new feature of wolframscript in version11.1

The verion 11.1 is available now,so the page of Mathematica Quick Revision History have summarize its upgrade.But the second last item is Self-executing Wolfram Language scripts extended to Windows ...
3
votes
0answers
135 views

How to send string to clipboard by wolframscript

Bug introduced in 11.0 and fixed in 11.1. This is my "t.txt" file ...
3
votes
0answers
196 views

A question on wolframscript

I'm trying to run a wolframscript by run RunProcess[{"wolframscript", "-file","my/script/file.wl"}]; The script file is too lengthy to be presented here. At ...
3
votes
0answers
295 views

`ParallelTable` pending the MathKernel after execution

I have done a ParallelTable computation in script mode. After execution, the output is fine and I've got all the data I needed. but the kernel seems pending, ...
3
votes
0answers
124 views

How to get information during evaluation of a Mathematica script?

I have a Mathematica script table=ParallelTable[f[u],{u,0,40,.5}] Export["filename.csv",table] that computes and exports a table of a rather complicated function ...
2
votes
0answers
37 views

Querying WolframAlpha from WolframScript

Is it possible to query WolframAlpha from a wolframscript query? The following yields $Failed: ...
2
votes
0answers
37 views

How to have batch script wait for free licence before executing?

Is there any way to make a mathematica script (that I'm running in batch using HTCondor) wait until there is an available licence before executing? Several of my scripts are returning nothing but ...
2
votes
0answers
151 views

Wolfram Script as a Scheduled Task on Windows Server

I have a wolfram script file (.wl) that processes a csv file and generates a PDF output. I have written a PowerShell Script which checks for new input data files and runs the wolfram script file over ...
2
votes
0answers
101 views

How to get smooth fonts in SVG graphics generated through a WolframScript script?

Below are screenshots of the x-axis labels plots generated and exported in SVG format using exactly the same code, either "interactively" or "programmatically": interactively programmatically By "...
2
votes
0answers
186 views

mathematica example for parallel run

I want to run a parallel mathematica example via a PBS script. I am not expert in this application, instead as a system administrator, I have to be sure that users are able to submit parallel jobs to ...
2
votes
0answers
356 views

FrontEndObject::notavail: error when using math

I am new to mathematica script and thus I don't know whether this generated error is natural or not. When I write a command such as echo "3" | math in the terminal....
2
votes
0answers
159 views

Find where an error occurred in a bunch of command line scripts

I have been using my intuition to solve errors in my Mathematica scripts. But when calculations got more complex and I started getting errors involving code in more participating scripts (a script ...
2
votes
0answers
787 views

Script with command line argument

As a test I want a simple script to take a command line argument and print it to a file: ...
2
votes
0answers
78 views

How to ensure that command line variables are secure for MathKernel scripts?

Suppose I write a Mathematica script, called test.m, like the following: Print["Hello, World!"]; test = ToExpression[$CommandLine[[-1]]]; Print["I'm alive!"]; ...
1
vote
0answers
45 views

Script aborts when I try to build a very large list

I am running the code below ...
1
vote
0answers
36 views

Saving a WolframScript File to the cloud?

Is there a way to save the current (or some target) WLS file to the cloud programattically (via wolframscript)? So if we are editing, i.e., ...
1
vote
0answers
18 views

Loading a file immediately upon launching the wolframscript REPL

When running, i.e., a bash shell, usually a file is automatically imported upon launch for convenience (~/.bashrc). Can one do something similar when launching <...
1
vote
0answers
18 views

How to execute .wls as a web call through Windows IIS

If I have a simple test.wls file (Print["hi"];2+2) that works running in Command Prompt, how do I get it to run through IIS on Windows Server? It just comes up with ...
1
vote
1answer
54 views

Getting a link to a Wolfram Cloud notebook from a WolframScript query?

Is there a way to make something like wolframscript -code 'Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}]' -cloud spin up a new Wolfram Online notebook with the ...
1
vote
0answers
44 views

Getting wolframscript to print out error messages?

While running a .wls file from the command line using wolframscript, is there a way to get the error messages printed to the command line?
1
vote
0answers
52 views

Passing custom options to WolframScript file

I have an example of WolframScript file file.wls with the following contents. ...
1
vote
0answers
23 views

WolframScript fails silently intermittently (but only when connected to internet)

When I execute "wolframscript" from a bash shell repeatedly, it sometimes starts up, and sometimes fails. Failures occur about half of the time. The failure is silent. If I turn wifi off (so that I ...
1
vote
0answers
52 views

Privilege violation for file or directory

hopefully somebody can help me out with the following; I have a mathematica .wl script which uses ParallelTable; When I run this locally (laptop) it works ...
1
vote
0answers
44 views

RandomVariate without zero

I want to get 10 random numbers drawn from a Poisson distribution with mean 1. But I do not want to include 0 in this. When I do ...
1
vote
0answers
83 views

Parallel execution in $2 \times 4$ kernels

Let's say I have 8 CPUs available on a single node. I want to run two instances of the same script (from command line with wolframscript in args > out &) on that node in parallel. Is there a way ...
1
vote
0answers
65 views

Export in wolframscript moves focus to Mathematica app

I'm running Mathematica 11 from command line on OS X El Capitan. As far as I know, I can only pass command line arguments using the wolframscript command. Here's my ...
1
vote
0answers
68 views

Evaluate .nb automatically and sequentially using external file as input

I am interested in implemented the following workflow. I have a Mathematica script that receives an input (manually), executes the algorithm based on that input, and stores output into a CSV file. ...
1
vote
0answers
45 views

Different WordData results between notebook and command line

When I run p = WordData["classy", "PhoneticForm"]; Print[p]; Print[StringLength[p] ]; in a notebook, the result is ...
1
vote
0answers
70 views

running the mathematica script in SQL Server

Hi i am trying to learn mathematica. I am following instruction in one of the questions asked before and did the following: In SQL Server a stored procedure is created as follows: ...
1
vote
0answers
58 views

*Form is not working in script

I want to generate code with a script. But functions as CForm, FortranForm and TeXForm does ...
1
vote
0answers
100 views

Running a script that needs a package

I am running a resource extensive notebook, and so I am trying to break it down into a .m file so that I can run it quicker and without using the mathematica interface. The problem is that my notebook ...
1
vote
0answers
113 views

Needs entry point of a package from a Mathematica script

I am writing a bunch of Mathematica scripts to run command line in a HPC environment. I am organising my solution in small chunks I can test separately. So I have a directory structure like: ...