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

learn more… | top users | synonyms

1
vote
0answers
60 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
60 views

How to batch run Mathematica code from Python?

I have this notebook: ...
2
votes
2answers
125 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
101 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
31 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!"]; ...
4
votes
1answer
96 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
180 views

How to use a Mathematica file for system maintenance [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 ...
1
vote
0answers
163 views

How to run external program in Mathematica?

In fact, I want to do the following in some kind of sense automatically, thus a windows bash file or Mathematica code will be welcome. Suppose I have a pdf file, lets name it as ...
5
votes
1answer
128 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
165 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
243 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
66 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 ...
8
votes
3answers
301 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: ...
3
votes
1answer
136 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 ...
3
votes
2answers
340 views

How to create an executable notebook in Mac OS X

All, I am looking for help to create a notebook to be executed via terminal in MAC OSX. The notebook uses the front end. This is what I have so far ...
5
votes
3answers
210 views

Executing Mathematica script from inside SQL Server

Does anyone have experience in calling Mathematica from inside SQL Server to do calculations? For example, how can I make a Procedure that uses Mathematica? Or a job that runs some Mathematica script? ...
2
votes
1answer
75 views

Is it possible to print more than last line with Get (<<) without using Print commands?

I want to run my Mathematica scripts from the terminal and I want it to print lines like MATLAB would. That is, suppress output by ending a line with ;, and ...
3
votes
0answers
169 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
2answers
390 views

Is there a way to get user input when running a script on a Linux terminal?

I have access to a node of a Linux cluster, on which Mathematica is installed. However, I do not have access to a Linux GUI. Typically I write and test Mathematica scripts on my Windows personal ...
0
votes
1answer
113 views
11
votes
1answer
242 views

Formatting and printing lists with Mathematica scripts

I'm just starting out with Mathematica and I'm using MathematicaScript rather than the GUI. However, I'm having trouble formatting a list when printing it. Suppose ...
0
votes
1answer
203 views

StringJoin/FileNameJoin doesn't quite work in script

My mathematica script is as follows: ...
11
votes
1answer
358 views

Why are all the lines commented when I create a Mathematica script?

When I created a Mathematica script, I found that all my lines were commented out (when opened with vi or gedit or any other ...
9
votes
2answers
262 views

Simultaneously running the same .m file with different inputs

I have my Mathematica code in a .m file and I run it from the command line with some parameters. I was wondering, if there is no overlap in input and output files, ...
10
votes
2answers
359 views

Evaluator option for Mathematica Scripts

I have mathematica with many additional kernels besides Local ( e.g., core1, core2, core3, core4 ... ) added through Kernel Configuration Options. I have been running multiple copies of a simulation ...
7
votes
1answer
253 views

Launch a specific notebook automatically when Mathematica starts

I run Mathematica on an iMac running OS X 10.6.8. I have set the OS's "Launch Items" to include Mathematica so that the application opens when the computer boots. Now I want to go further and ...
13
votes
3answers
1k views

Mathematica script - passing command line arguments

When using Mathematica script #!/usr/local/bin/MathematicaScript -script Print[$ScriptCommandLine] and running it with some arguments: ...
5
votes
0answers
517 views

Command-line execution of Mathematica scripts/notebooks very slow

I'm new to Mathematica and am trying to adapt a pre-existing notebook, designed for manual evaluation of individual simulation outputs, to batch process the outputs of multiple simulations. Currently, ...
12
votes
3answers
495 views

Reading from STDIN, or: how to pipe data into Mathematica

Today I tried using Mathematica's plotting capabilities to display the output of a C++ program. This made me wonder whether it is possible to somehow tell a Mathematica script to read from STDIN and ...
0
votes
0answers
226 views

Mathematica as Windows Service — Problem with Error Messages

I have installed Mathematica in a Windows machine as a service using srvany and now I have problems with error messages — they don't get written in logs file like they should! For example, if I do: ...
8
votes
2answers
788 views

Printing a string in a Mathematica script

Here's a simple script saved in the file hello #!/usr/local/bin/MathematicaScript -script Print["Hello world"] I can then run ...