Re: applescript
- To: mathgroup at smc.vnet.net
- Subject: [mg108500] Re: applescript
- From: Armand Tamzarian <mike.honeychurch at gmail.com>
- Date: Sat, 20 Mar 2010 02:46:19 -0500 (EST)
- References: <hnicpk$st7$1@smc.vnet.net> <hnss2a$5qh$1@smc.vnet.net>
On Mar 18, 4:34 am, "alexxx.ma... at gmail.com" <alexxx.ma... at gmail.com> wrote: > it's a pity that nobody seemed interested, but for the sake of future > users googling about this problem, here's what I found: > > 1) by using this simple script (thanks to Achilleas Lazarides) > > tell application "Mathematrica" > question="FactorInteger[987654321]" > set x to do script question > display dialog x > end tell > > I get the answer {{3,2},{17,2},{379721,1}} > > 2) by this instead: > > tell application "Mathematica" > set s to "Graphics3D[Table[{RGBColor[RandomReal[1, 3]], > Sphere[RandomReal[3, 3], RandomReal[{0.2, 0.4}]]}, {i, 5}], Boxed -> > False]" > set es to "Export[\"a.pdf\"," & s & "]" > do script es > end tell > > I get a perfect pdf file with the output of any graphic command > > alessandro > > On 14 Mar, 11:12, "alexxx.ma... at gmail.com" <alexxx.ma... at gmail.com> > wrote: > > > hi everybody, > > after using Linux machines since forever, I am now using a macbook, > > and I just discovered what is IMHO the one and only feature where OSX > > leaves Linux (and Win of course ;-) behind: the universal ability to > > make apps communicate one with the other via Applescript. > > (dont flame me: I know I can link Mathematica with C apps and so on... > > the point is just that Applescript is universal & painless to use...) > > > Anyway: I just installed Mathematica, and found out in the Applescript > > editor that Mathematica seems indeed scriptable: opening its > > dictionary reveals "Required suite", "Standard suite" and "Mathematica > > suite", with names and verbs with which to operate. > > Unfortunately, I am completely new to Applescript and dont know how to = begin. > > Googling around I discovered MathLink for Applescript > > (www.unisoftwareplus.com/products/mathlinkosax/), but it seems an old > > product, and moreover I'd like to communicate with Math without > > installing anything else. > > > So I just want to ask if any of you has experience on scripting > > Mathematica from the outside! > > > thanks... > > > alessandro You may also be interested in Math Service: http://library.wolfram.com/infocenter/MathSource/5180/