MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Lauching application from an icon

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110660] Re: Lauching application from an icon
  • From: telefunkenvf14 <rgorka at gmail.com>
  • Date: Thu, 1 Jul 2010 08:26:17 -0400 (EDT)
  • References: <hut8d2$j9p$1@smc.vnet.net> <i023q4$r9m$1@smc.vnet.net>

On Jun 25, 6:27 am, Chris Degnen <deg... at 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... at 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


  • Prev by Date: Expression for manipulate controls
  • Next by Date: Re: Run Package vs Needs
  • Previous by thread: Expression for manipulate controls
  • Next by thread: Need to Speed up Position[]