For questions about MathematicaScript, or running the kernel without direct user interaction.

learn more… | top users | synonyms (1)

2
votes
1answer
91 views

Run mathematica scripts without initializing the kernel every time

There are two duplicate's of this question that seem to only work on linux/osx currently. So how can I viably run mathematica scripts without spawning a new session each time from command prompt? I ...
4
votes
0answers
43 views

When I run multiple Mathematica programs from terminal, are they supposed to use different Kernel?

Since I found that when I using notebook interface, I need to assign different kernels to different notebooks (if I want to run them at the same time), I wonder if I run those *.m files from terminal ...
3
votes
1answer
52 views

Analogue of NotebookDirectory[] for scripts (to get the directory path of my script.m)?

Is there a way to get the script directory from inside a Mathematica script? I want a function analogue to NotebookDirectory[] (which doesn't work for scripts). Is ...
5
votes
1answer
77 views

Wolfram Script Not Completing when ran as cron job

I have a fairly simple Wolfram script called from within a shell script that I would like to run at certain times. The shell script calls a python script to get some recordings to from GPIO and saves ...
4
votes
1answer
109 views

Executing Mathematica code via Notepad++

I wonder if there is a way to execute Mathematica code via Notepad++. After some searching on the web, I found that there is a user-defined language that supports Mathematica highlighting, but there ...
0
votes
0answers
104 views

Can I open Mathematica to plot something via some kind of Windows command?

I have a software package for alternative musical tunnings called Scala. This package has a command to plot a musical scale using gnuplot. It seems that Scala sends some kind of command to Gnuplot and ...
0
votes
0answers
47 views

Notebook vs. Kernel: Kernel giving inaccurate results

I am running a code on Mathematica (on Mac OS X) that takes high values for some of the variables. In Notebook, I set the global precision using the following code (which is well documented!) at the ...
1
vote
0answers
59 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 ...
1
vote
1answer
62 views

Auto Execute Notebook on Open [duplicate]

How might I automatically execute a notebook script on open? For example I would like to a notebook to automatically execute it's cells.
3
votes
0answers
79 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.
11
votes
3answers
412 views

Windows command line arguments, stdin & stdout

Is it possible to utilize all three: command line arguments, stdin, and stdout all at once in script for Windows? Unix is fairly easy, but I can't get the following to work with Windows. Using the ...
0
votes
0answers
120 views

running math file as batch job

I am trying to run the following mathematica program, ...
1
vote
1answer
88 views

Mathematica script file in Linux - how to export PDF file and close kernel?

tmp.m file: tmp = Table[RandomReal[], {3}, {4}] Export["test.xlsx", tmp] Quit[] Then ...
2
votes
2answers
133 views

How to stop a .sh script that calls multiple Mathematica scripts?

When I press Ctrl + C in a linux console running a Mathematica script, it doesn't stop. Instead it brings a console where I am supposed to type either quit, or ...
0
votes
0answers
92 views

Expecting an image or graphics instead of -Image-

Here's a snippet of my notebook. When run with the frontend, the code runs fine with no problem at all. However, when I save the notebook as .m file and run it using "Mathkernel -noprompt -script ...
2
votes
1answer
352 views

Proper way to run a Mathematica script (-script vs -run vs MathematicaScript vs <)?

Suppose I have a Mathematica script called test.m. There at least 4 ways to run this from the terminal: ...
4
votes
2answers
83 views

exporting mathematica videos [closed]

Peter Boardman has created a most excellent tutorial titled, "Basic Image Processing in Mathematica." It is an iBooks presentation that only runs on the iPad and 'feels' similar to a Powerpoint ...
26
votes
1answer
473 views

math.exe vs wolfram.exe vs MathKernel.exe vs WolframKernel.exe (running scripts on Windows)

I generally consider Mma documentation very good. However, it is startlingly difficult to find useful information on running Mma batch scripts, especially on Windows. So ... just what would I enter ...
2
votes
0answers
82 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 ...
1
vote
0answers
80 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: ...
2
votes
0answers
84 views

Session logging of “\$Echo” and “\$Output” in Mathematica 10

I have difficulties with session logging and Mathematica 10. In previous versions, you could simply use AppendTo[$Echo, logfile] and ...
0
votes
1answer
96 views

Mathematica on a cluster

I try to run mathematica on a grid. Since this is my first time working on a cluster, I have no plan what to do. I have to run a job (pbs-file). ...
2
votes
1answer
238 views

Mathematica script - Using front end

I'm running Mathematica on OS X and I want to create an Automator action that converts spreadsheet files. I have written this script: ...
0
votes
1answer
200 views

How to record all the output (including error messages) of a mathematica script in a file?

Is it possible to record all the output of a Mathematica script to a file? I am looking for the Mathematica equivalent of ...
2
votes
1answer
1k views

Running a shell script within Mathematica

The title pretty much explains it and I have not found something similar already posted. Perhaps I am not searching for the correct title or maybe this is something very basic, but I would appreciate ...
1
vote
0answers
41 views

Sending a command to an already opened frontend

I'm trying to pipe low-level notebook commands to work through terminal and I've tried various ways, but I can't really get to the frontend that's already open. For example Opening a notebook from ...
1
vote
0answers
90 views

Multiple scripts run using same kernel

I have an external program that calls Mathematica scripts upon certain events. Each script requires a large Mathematica library to load (takes a while). Is there some way to run an initial script ...
1
vote
1answer
75 views

Write memory usage to file in script

Is there a way to write the MemoryInUse into a file once a minute? In this Debugging memory leaks question there is a neat dynamic diagram showing the MemoryInUse over time. My problem is that I run ...
6
votes
1answer
418 views

Mathematica scripting on Microsoft Windows

Is it possible to use Mathematica (or the Mathematica kernel) to interact with Microsoft Windows, much like any macro-based scripting language that controls the keyboard/mouse, opens/closes programs ...
4
votes
1answer
666 views

Wolfram language from batch or py

I would like to automate the commands in this website into a batch file, so when the batch file it runs these commands in sequence. http://community.wolfram.com/groups/-/m/t/157461 Do any of you have ...
10
votes
1answer
761 views

Scheduling Mathematica scripts to run from a command line [duplicate]

I want to run Mathematica "jobs" on a daily/weekly basis to do system maintenance and as part of daily processing operations. What is the best way to do this?
3
votes
1answer
134 views

How to start Mathematica kernel without loading init.m?

Is it possible to start Mathematica kernel from UNIX command line without having the init.m loaded, but not by simply deleting or commenting out it before hand? If this is a Mathematica script, is it ...
2
votes
1answer
284 views

Run kernel script in cygwin without window popping up

I'm calling mathematica scripts running kernels through a cygwin terminal, which are again executed from c++ code. When I do this a window pops up, prints warnings and errors if there are any, and ...
3
votes
0answers
90 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 ...
6
votes
2answers
274 views

Why does Mathematica stop when run in the background in command line mode?

If I try to start a Mathematica script in the background from the command line, like this: math -script someFile.m & then the process gets automatically ...
4
votes
0answers
131 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 ...
3
votes
1answer
143 views

How to catch an interrupt (Control-C) in a script?

If a user hits Control-C when a script is running, they get an Interrupt> prompt, where they have to type exit or ...
2
votes
0answers
282 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: ...
3
votes
0answers
185 views

How to batch run Mathematica code from Python?

I have this notebook: ...
6
votes
2answers
3k views

Command line execution of Mathematica notebooks and conversion to .m

Sometimes one may want to execute a notebook via the command line (for example to run it remotely). As far as I know it's not possible to run notebooks directly, but ...
3
votes
3answers
417 views

Temporarily redirect the output of Print[ ] to a second file

I have started using Mathematica to automate file backup operations. The logistics I need make Mathematica a good choice. I am testing and developing the Notebook manually, and ...
2
votes
0answers
56 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!"]; ...
7
votes
1answer
185 views

Saving a source file adds (* ::Package:: *) to the first line

I am running Mathematica 9 on a linux machine and I've encountered the following behaviour that I am trying to understand. When I'm editing multiple source (.m) files using mathematica saving adds a ...
4
votes
2answers
393 views

How to automate Mathematica scripts? - I [duplicate]

I would like to use the Windows Task Scheduler, or Visual Cron, to start a Mathematica notebook or .m file to do some system maintenance tasks: copy files from one place to another, etc. How do I set ...
5
votes
1answer
303 views

How to import non-text data from std input in a Mathematica script?

Or maybe a better question is - how can I get a stdin stream? I need to run on Linux. I did look at Reading from STDIN, or: how to pipe data into Mathematica, but ...
2
votes
1answer
273 views

Custom (Frame)Ticks fail when using Mathematica's script engine

I want to define my own ticks in a DateListPlot. It works quite well when I use the code in a Mathematica Notebook but breaks somehow when using it via ...
4
votes
1answer
395 views

Doubts on scripting: error messages when trying to run and how to process lots of files

I have created my first mathematica 'program' as I think of it, to do some image processing. After reading in an image, it does a lot of stuff (including smoothing, fourier transform, functional ...
0
votes
1answer
108 views

Possible to use Manipulate in GUIRunModal?

Is it possible to use the widget created by Manipulate within GUIRunModal? I intend to run the file using ...
11
votes
3answers
989 views

Why doesn't my script work when I redirect stdout?

I'm using Mathematica Home Edition 9.0.1 on Mac OS X 10.8.2. I have this script: ...
4
votes
1answer
497 views

Interrupting package evaluation, handling error

I have some packages/scripts that I schedule the execution using Jobs in SQL server. For example, in some of then, I use to create reports and delivery by mail using Mathematica. All done using ...