From: Chris Degnen on
Is there some way to start a Mathematica application from an icon?
I tried using a batch file to no avail, e.g.

@echo off
"C:\Program Files\Wolfram Research\Mathematica\7.0\Mathematica.exe" -
run KernelExecute[Get["MyPrograms`StartDialog`"]]


There are only two command-line options shown here:-

http://reference.wolfram.com/mathematica/ref/program/Mathematica.html

From: Chris Degnen on
I have still found no way to launch a Mathematica application in
the front-end, directly from an icon (or via cmd).
On a previous thread:
http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/022d34bca79f6375?pli=1

the following were suggested, but they don't work. Any ideas?

(cmd line) start foo.nb
containing:
UsingFrontEnd[
nb = NotebookOpen["MYFILETOEXECUTE.nb"];
SelectionMove[nb, All, Notebook];
FrontEndTokenExecute[nb, "EvaluateCells"];
]

or

MathKernel -noprompt -run "(*some command*);Quit[]"


On Jun 11, 12:58 pm, Chris Degnen <deg...(a)cwgsy.net> wrote:
> Is there some way to start a Mathematica application from an icon?
> I tried using a batch file to no avail, e.g.
>
> @echo off
> "C:\Program Files\Wolfram Research\Mathematica\7.0\Mathematica.exe" -
> run KernelExecute[Get["MyPrograms`StartDialog`"]]
>
> There are only two command-line options shown here:-
>
> http://reference.wolfram.com/mathematica/ref/program/Mathematica.html


From: Chris Degnen on
Hi David,

I simply mean launch an icon and evaluate cells in one go. For instance, by a
command from the command line, which could be put in a batch file.


David Park asked:
>

> What do you mean by: "launch a Mathematica application...directly from an
> icon"?
>
> It is specific notebooks that are "launched" by Mathematica. In Windows,
> at
> least, you can simply drag a notebook to the desktop and create an icon.
> When you double-click the icon the notebook will open. I suppose one could
> also put the notebook on the task bar and open it with a single click.
> (The
> notebook itself might have initialization cells that load any packages in
> the application, and maybe even bring up the main documentation guide
> page.)
>
> Often, when I am working on some project that has many notebooks in a
> folder, I create a shortcut icon for the folder on the desktop. It's easy
> to
> create these and then delete them when you are no longer using them.
>
> I don't know if that is what you are thinking of.
>
> I also have a shortcut icon on my desktop that links to a folder that
> contains links to the common folders that I often use.
>
> I also have a CurrentBackup folder on my desktop (not a shortcut) where I
> can copy current notebooks I am working on as a temporary backup between
> system or DVD backups.
>
>
> David Park
> djmpark(a)comcast.net
> http://home.comcast.net/~djmpark/
>
>
>
> From: Chris Degnen [mailto:degnen(a)cwgsy.net]
>
> I have still found no way to launch a Mathematica application in
> the front-end, directly from an icon (or via cmd).
> On a previous thread:
> http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/
> thread/022d34bca79f6375?pli=1
>
> the following were suggested, but they don't work. Any ideas?
>
> (cmd line) start foo.nb
> containing:
> UsingFrontEnd[
> nb = NotebookOpen["MYFILETOEXECUTE.nb"];
> SelectionMove[nb, All, Notebook];
> FrontEndTokenExecute[nb, "EvaluateCells"];
> ]
>
> or
>
> MathKernel -noprompt -run "(*some command*);Quit[]"
>
>
> On Jun 11, 12:58 pm, Chris Degnen <deg...(a)cwgsy.net> wrote:
>> Is there some way to start a Mathematica application from an icon?
>> I tried using a batch file to no avail, e.g.
>>
>> @echo off
>> "C:\Program Files\Wolfram Research\Mathematica\7.0\Mathematica.exe" -
>> run KernelExecute[Get["MyPrograms`StartDialog`"]]
>>
>> There are only two command-line options shown here:-
>>
>> http://reference.wolfram.com/mathematica/ref/program/Mathematica.html
>
>
>
>
>



From: David Park on
What do you mean by: "launch a Mathematica application...directly from an
icon"?

It is specific notebooks that are "launched" by Mathematica. In Windows, at
least, you can simply drag a notebook to the desktop and create an icon.
When you double-click the icon the notebook will open. I suppose one could
also put the notebook on the task bar and open it with a single click. (The
notebook itself might have initialization cells that load any packages in
the application, and maybe even bring up the main documentation guide page.)

Often, when I am working on some project that has many notebooks in a
folder, I create a shortcut icon for the folder on the desktop. It's easy to
create these and then delete them when you are no longer using them.

I don't know if that is what you are thinking of.

I also have a shortcut icon on my desktop that links to a folder that
contains links to the common folders that I often use.

I also have a CurrentBackup folder on my desktop (not a shortcut) where I
can copy current notebooks I am working on as a temporary backup between
system or DVD backups.


David Park
djmpark(a)comcast.net
http://home.comcast.net/~djmpark/



From: Chris Degnen [mailto:degnen(a)cwgsy.net]

I have still found no way to launch a Mathematica application in
the front-end, directly from an icon (or via cmd).
On a previous thread:
http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/
thread/022d34bca79f6375?pli=1

the following were suggested, but they don't work. Any ideas?

(cmd line) start foo.nb
containing:
UsingFrontEnd[
nb = NotebookOpen["MYFILETOEXECUTE.nb"];
SelectionMove[nb, All, Notebook];
FrontEndTokenExecute[nb, "EvaluateCells"];
]

or

MathKernel -noprompt -run "(*some command*);Quit[]"


On Jun 11, 12:58 pm, Chris Degnen <deg...(a)cwgsy.net> wrote:
> Is there some way to start a Mathematica application from an icon?
> I tried using a batch file to no avail, e.g.
>
> @echo off
> "C:\Program Files\Wolfram Research\Mathematica\7.0\Mathematica.exe" -
> run KernelExecute[Get["MyPrograms`StartDialog`"]]
>
> There are only two command-line options shown here:-
>
> http://reference.wolfram.com/mathematica/ref/program/Mathematica.html




From: telefunkenvf14 on
On Jun 25, 6:27 am, Chris Degnen <deg...(a)cwgsy.net> wrote:
> I have still found no way to launch a Mathematica application in
> the front-end, directly from an icon (or via cmd).
> On a previous thread:http://groups.google.com/group/comp.soft-sys.math.mathematica/browse_...
>
> the following were suggested, but they don't work. Any ideas?
>
> (cmd line) start foo.nb
> containing:
> UsingFrontEnd[
> nb = NotebookOpen["MYFILETOEXECUTE.nb"];
> SelectionMove[nb, All, Notebook];
> FrontEndTokenExecute[nb, "EvaluateCells"];
> ]
>
> or
>
> MathKernel -noprompt -run "(*some command*);Quit[]"
>
> On Jun 11, 12:58 pm, Chris Degnen <deg...(a)cwgsy.net> wrote:
>
> > Is there some way to start a Mathematica application from an icon?
> > I tried using a batch file to no avail, e.g.
>
> > @echo off
> > "C:\Program Files\Wolfram Research\Mathematica\7.0\Mathematica.exe" -
> > run KernelExecute[Get["MyPrograms`StartDialog`"]]
>
> > There are only two command-line options shown here:-
>
> >http://reference.wolfram.com/mathematica/ref/program/Mathematica.html

Have you tried SystemOpen[] or Run[]? I'm betting one of these is what
you want... SystemOpen[] enables you to open any system file,
including notebooks. For example:

SystemOpen["C:\Users\x61Tablet\Desktop\\temp.nb"] and you could set
cells in that as initialization cells, etc.

You might also want to set the notebook up to evaluate in a separate
Context[] so as not to conflict with existing definitions in Global`.

-RG