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.

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

Export data in a .wls script

I am currently facing the problem that the Export function does not behave as expected if I execute my code as a .wls script. I execute my test.wls file in my ...
-1
votes
0answers
30 views

How to get a function from a set of values? [closed]

I am trying to figure out an algorithm for the following task: There is a list of players, players have points. There is a picture, on it are drawn levels (of which there are currently 6) and the ...
0
votes
0answers
61 views

Solve ODE system efficiently with mathematica

I've been trying to solve a system of ODE's with mathematica, which is a master equation of a hierarchically organized tissue model, where I want to quantify the number of cells at level 'k' with 'm' ...
0
votes
0answers
127 views

Installing WolframScript (12) on OSX (Catalina)

I did a clean install of Catalina (OSX 10.15) and Mathematica 12.0 installation was flawless. However I can't install WolframScript which I greatly need. During the installation, after typing my ...
0
votes
1answer
39 views

How to extract the last output from the Maximize

Pitty on me! Still a beginner. After using Mathematica for 8 years and spending an hour on google, I remained unsuccessful to find an answer of: How to extract the last element of the output of ...
3
votes
1answer
47 views

wolframscript command line output from ParallelDo kernels contains lots of gibberish

I run this code: ParallelDo[ Print["Hi"];, {i,Range[2]} ] And I get this: ...
0
votes
0answers
21 views

script to remove multiple Connection Linkedin

Unfortunately i have so many Connections About 20,000 in Linkedin, so i need to delete them all in multiple way, but Linkedin allow one by one. i searched there's a way in Internet, but all of them ...
1
vote
0answers
45 views

Script aborts when I try to build a very large list

I am running the code below ...
0
votes
1answer
33 views

Conditions for solving in NDSolve

I'm trying to solve a system of ODEs but each variable is a probability so I should solve each variable for a range between 0 and 1 and with the sum of all variables equal to 1. This is the system ...
5
votes
1answer
59 views

How do I reliably read from stdin using wolframscript?

I am trying to direct a stream of data to a wls script in a command line environment. Wolframscript provides the ...
0
votes
0answers
44 views

Wolframscript - no output from command when exec'd from php

I am trying to run a simple command via php: echo shell_exec('wolframscript -code 2+2'); However, I am unable to get any output from this command when run like ...
0
votes
1answer
64 views

WolframScript not simplifying output

I'm trying to multiply a matrix and a vector (imported from a csv) in Wolframscript to speed up a process normally done with Mathematica notebooks. This is my first time using Wolframscript, however, ...
0
votes
0answers
46 views

How to turn an algorithm into a function

I have written a script to help me find the several local minima of a dataset. It takes two arguments: the dataset list and an x-coordinate value that tells the script from where to start looking for ...
0
votes
1answer
79 views

Passing arguments into WolframScript in batch mode

I am looking for a way to passing arguments into a WL script when WL run in batch modes. The test script is: ...
0
votes
0answers
33 views

Passing arguments into package from a command line

I am interested in running the same experiment with the different initial state. So, I am looking for a way to passing arguments into a plain text .m file from the ...
1
vote
1answer
59 views

Run a shell script and pass arguments from inside mathematica

Is it possible to run a shell script AND pass it arguments from Mathematica? I have searched thoroughly and been unable to find a way to do this. I want to avoid having to write a .wls for this ...
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 <...
0
votes
0answers
51 views

What techniques have you employed to avoid loop in Mathematica? [duplicate]

It appears to me that loop in mathematica is very slow (compared with matlab). Since many people still use mathematica to finish their work, there must be some techniques to bypass this problem. ...
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
60 views

Calculation of Legrende Polynominals via Rodrigues Formula [closed]

I want to calculate Legendre Polynominals via Rodrigues formula for n=0,...,10 I wrote this down but how can I calculate n = 0,...,10 ? ...
7
votes
1answer
116 views

What is an example of of idiomatic “typed” WolframScript?

I'd like to make my own "typed function" in WolframScript. Suppose the type we desire is called money, and we'd like to make a function called ...
1
vote
1answer
51 views

Removing Extra Points When Finding an Audio Envelope

I am trying to reproduce Camtasia's way of displaying audio signals which is a strictly positive envelope of the audio signal and very easy for me to identify some sounds visually. These are displays ...
0
votes
0answers
43 views

Testing if a function input is an integer

I am wondering why code like digitback[n_Integer] := Framed[Reverse[IntegerDigits[n]]] can check if the input for the function is an integer (this is the ...
6
votes
1answer
101 views

TeXForm doesn't work in wolframscript?

Consider that $ wolframscript -cloud -code 'TeXForm[ (d u)/(d t)]' TeXForm[u/t] yet I don't have a local wolframscript kernel installed. Is this something ...
0
votes
0answers
67 views

WolframScript Causing Gibberish Characters When Printing to Console

Placing the following in ./file.wls: e1 = a (x + I y) E^(I θ) ComplexExpand[e1] and running ...
0
votes
0answers
18 views

Running CloudDeploy from WolframScript

The following $ wolframscript -cloud -code "CloudDeploy[Manipulate[n, {n, 1, 100}]]" yields ...
2
votes
0answers
37 views

Querying WolframAlpha from WolframScript

Is it possible to query WolframAlpha from a wolframscript query? The following yields $Failed: ...
3
votes
1answer
119 views

Creating flags to use with wolframscript?

Is it possible to create flags to pass arguments into a script with wolframscript? I am trying to pass multiple variables that correlate to specific keys. For example, wolframscript -script ...
2
votes
2answers
202 views

Mathematica code in fortran [closed]

I have an integral in which the integrand is a combination of ratio of modified bessel function of second kind. I am able to find the solution of this integral with mathematica Nintegrate module with ...
1
vote
1answer
66 views

How to create a find-and-replace code in Mathematica?

Let's say I have a group of X's characters that I want to cut down. I want to use a method similar to 'find-and-replace-all' tool from Word, which takes an amount of X's each time, deletes them, and ...
10
votes
1answer
359 views

How does one use the free Wolfram Engine for developers on Linux?

I just downloaded wolframscript on Linux. Downloading the "free wolfram engine for developers" gives me a ...
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
43 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?
4
votes
1answer
69 views

Context leak in Wolfram Script?

hello.nb SetOptions[EvaluationNotebook[], CellContext -> Notebook] Print["hello"]; a = 1; Print[a]; Print@Context[] bye.nb ...
0
votes
0answers
22 views

Console Output to file corrupted

When i run WolframScript and write the output of a *.wls to a file and then modified the program slightly, i started getting these more exotic outputs. The function used is NetTrain. Does someone ...
-2
votes
1answer
31 views
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
1answer
197 views

Electric Field Plot

I want to show an electric field of several arrangements of point charges in xy-plane. I wrote a routine that plots an electric field of a charge: ...
0
votes
0answers
23 views

String getting modified after exporting to PDF

I create and export the plot: ...
0
votes
0answers
26 views

API is not responding

I am looking at the examples of wolframscript to learn its capabilities and syntax. In one of the examples the following API is considered. ...
0
votes
1answer
58 views

Writing a script that exports results depending on user input

Is there a way to tell Export to hold its arguments and just Export. I tried to use ...
1
vote
1answer
53 views

Disable Message Windows

Is there any way to disable Mathematica's internal popup windows, such as "Why the beep?" Cannot seem to find any documentation on the ability to turn it off, but need it turned off to write some ...
2
votes
1answer
50 views

How to export parameters in a text file?

I have some parameters defined in my notebook as, for example, a=1; b=2; c=3; and I want to export these parameters to a .txt file in which I have the following ...
0
votes
0answers
47 views

Wolframscript does not terminate

I have a little package and a script. The portion in the script is copied from the Mathematica notebook and finishes just fine within half a minute on my laptop. Now I want to run this as a script on ...
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 ...
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 ...
2
votes
2answers
266 views

Passing arguments into a script in WolframScript

According to https://reference.wolfram.com/language/ref/program/wolframscript.html i can pass arguments to a file containing wolframscript. But i cannot find a way to actually use passed arguments. <...
5
votes
4answers
125 views

How to copy a string to the clipboard from a script?

How to copy a string to the clipboard from a script? I want the wolfram script to copy a string to the clipboard. Unfortunately the following script fails to do this. The same code works perfectly ...