Questions tagged [scripting]

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

Filter by
Sorted by
Tagged with
6
votes
1answer
311 views

How to recover WolframScript's former `-run` functionality?

With the 10.4 version of WolframScript, I could run something like ...
1
vote
1answer
54 views

Turning a NB into a Repeatable Script?

I am interested in "automating" the following notebook file so that I can execute it many times to generate many plots. ...
4
votes
1answer
69 views

Why is .mn file being generated?

I am running a Mathematica code inside a shell script, using math -script <filename>.m. But after the script finish its run, I get a duplicate (or backup?) ...
1
vote
1answer
47 views

How to get only X coord of Point

As result of RegionIntersection[], I got the Point object. Now I want to get it's x coord as a number. How can I do it in ...
2
votes
2answers
450 views

Parse command line arguments

I have been trying to parse command line arguments. There are a couple of types of options. 1. Mandatory 2. Optional 3. Alternative There are built-in/3rd ...
3
votes
0answers
195 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 ...
0
votes
1answer
209 views

Frequencies doubled in fourier transform [duplicate]

With this code I get a nice plot of the Fourier transform, but the frequencies are doubled. By this I mean that when using a sine wave I generated at 220 Hz, the plot gives me a single peak at 440 Hz. ...
6
votes
1answer
195 views

wolframscript creates tons of log files

On Linux, wolframscript seems to create log files in .Mathematica/ApplicationData/ProcessLink/Streams for example: ...
3
votes
0answers
205 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 ...
4
votes
1answer
400 views

How to run multiple scripts in a row from command line using the same kernel?

Here is my shell script so far (I am using MacOSX): ...
3
votes
0answers
142 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 ...
2
votes
0answers
115 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 "...
3
votes
0answers
227 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 ...
1
vote
0answers
81 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 ...
4
votes
1answer
1k views

Is it possible to write Matlab-like scripts in Mathematica?

I have been using the Notebook in Mathematica for quite a while. While I like its interface, the problem is successive statements sometimes get read into different Inputs, and when I am rerunning the ...
44
votes
2answers
3k views

Running Mathematica on Docker

I didn't find any information on the net about running Mathematica math/Wolfram Engine (wolframscript) in a Docker Container. Is ...
1
vote
1answer
76 views

How to specify $Path items on the command line?

On Unix, I can run Python scripts from the command line like this1: PYTHONPATH=lib/python path/to/script.py The setting of ...
2
votes
2answers
553 views

How to find source of `FrontEndObject::notavail` warning?

I converted a large notebook (a ton of code!) into a free-standing WolframScript. When I run the script: several warnings of the form ...
2
votes
1answer
158 views

Mathematica script, called from Windows task scheduler, does not export graphics

When I run the following script from command line, ...
1
vote
0answers
79 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
2answers
96 views

Catch error messages in script mode

For debugging purposes, I wrote a function which should log the error message to a file. It does not work and I cannot see why this is the case. Here is the function: ...
5
votes
2answers
511 views

Editing Wolfram Language Packages and Scripts

Background I am currently working on a large software development project written in the Wolfram Language and I would like to organize my code in Wolfram Language Packages and Scripts (.wl files. See ...
1
vote
0answers
48 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 ...
15
votes
2answers
1k views

Line by line processing with a WolframScript

I am having some difficulty understanding the correct syntax to enable a line by line processing of a file using a WolframScript. What I would like to do to mimic this simple python pipe in ...
2
votes
0answers
200 views

Wolframscript running slow on linux?

I tried running a simple wolframscript example on ubuntu with v11. Why does this example take so long? ...
19
votes
1answer
1k views

Difference between “wolframscript -f” and “wolframscript -script”

In Mathematica 11, there is new wolframscript.exe According to help wolframscript.exe -h -f [ -file ] arg---------Run a ...
1
vote
0answers
88 views

Write a mathematica script that returns the absolute path to its directory [duplicate]

Shell scripts occasionally hardcode paths to other files. This will break if these other files are relocated. Hence, you should refer to outside files always relative to the position of the shell ...
4
votes
1answer
312 views

wolframscript under Linux, version 11

I just installed v11, and I wanted to try wolframscript at the console. Whatever I try, it works, but always adding at the beginning the annoying warning ...
5
votes
1answer
1k views

How to use woframscript (Mathematica 11) on Win 10 console command line?

I was trying to understand how to use wolframscript (new in Mathematica 11) in a console window on Win 10. I set my Path environment variable to point to the ...
4
votes
1answer
107 views

Changing system shell

What I'd like to do is to have a Mathematica script use some user-defined bash functions before scheduling some calculations on the results generated by by these functions. Since I have them written ...
2
votes
1answer
137 views

Running an external simulation program from Mathematica

I have a physics simulation program which I run through a terminal window (I use a Mac) as shown below: user$ programName inputfile.ele I would like run a ...
1
vote
0answers
74 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: ...
0
votes
0answers
56 views

How to get a script to print MaxMemoryUsed[] upon getting a system signal?

I want to instrument a Mathematica script so that, upon receiving any system signal (e.g. SIGINT, aka Ctrl-C) it will print1 the ...
1
vote
0answers
69 views

*Form is not working in script

I want to generate code with a script. But functions as CForm, FortranForm and TeXForm does ...
5
votes
2answers
311 views

How to prevent a standalone kernel from opening windows?

I am trying to make Mathematica do some plots for me as a part of a script. I have a .m file that basically does Import[] on ...
6
votes
2answers
383 views

UseFrontEnd is not working the same in version 10.4

I'm using batch files to run Mathematica notebooks (with saved output) but in version 10.4 the functionality has changed. Any ideas how to get it working? I use a batch file to run a .m script which ...
18
votes
2answers
14k views

Running Mathematica Notebook files in command mode

The question is, how can I run a .nb file in the kernel mode of Mathematica? I am not an expert in Mathematica, but one of our users who use this program says that ...
2
votes
0answers
228 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 ...
0
votes
1answer
92 views

Use the same Mathematica Executable Script on Different Computers

The first line in a Mathematica executable script specifies the directory of WolframScript, e.g. #!/usr/local/bin/WolframScript -script Assume I want to run a ...
3
votes
1answer
857 views

Display line number/stack trace of error in script (i.e. batch mode / command line interface)

I am trying to set up a Mathematica script so that it runs from the command line in the manner that a sane person would expect. I have the following at the start of the file: ...
1
vote
1answer
141 views

How to print TeXForm running script?

I've got a simple script which runs in bash some code - I want now to get an answer in TeX Form. If I would run Mathematica code inside the interpreter, it would be easy: ...
3
votes
0answers
350 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, ...
1
vote
2answers
849 views

How to set the relative directory so that they work both in script and in notebook and portable?

Maybe the question is not clear, here I try to state it in more detail: I have a folder named project, for instance. In it I have two folders, one is named ...
4
votes
0answers
159 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 ...
2
votes
0answers
204 views

Random “silent” crash when running a math kernel in terminal for a long time [closed]

I sometimes use Mathematica to run very long calculations in the terminal (Debian). To do this I use the command: math -script (filename) Now after several hours ...
17
votes
1answer
1k views

Evaluating a notebook programmatically with -ne

I am running Mathematica 10.2 on an Ubuntu workstation. I would like to be able to evaluate a notebook through the command line, and save its final state so that I can launch evaluation remotely ...
6
votes
3answers
416 views

NotebookEvaluate with InsertResults -> True from the command line

Suppose I have a notebook template.nb like this: and I want to evaluate this notebook from the command line. So I wrote this Mathematica script: ...
3
votes
0answers
69 views

How to “fake” a front-end object when running a Mathematica script? [duplicate]

I'm running a Mathematica script (content of which cannot be disclosed here) and some part of it requires "front-end"? Since it's running in a script, there is not one and it gave the following error: ...
1
vote
0answers
107 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 ...
3
votes
1answer
441 views

kernel not running script

I'm on under OS X trying to run a script through the kernel. My actual plan is to run a bash script which would call mathematica with an address to process a file. I have finished the code (with ...