How to shut down the mac with Max ?

jml1985's icon

Hello,
I would like to quit the apps and shut down the Mac with a command in Max.
My Mac mini is into a sculpture and it have no keyboard and no mouse. Just an Arduino with sensors to pilot it. I have made an Applescript, it works good, but how can I trig it from Max?
Os 10.9.2
Max 6.1.6
I try Tap Tools but there is no object, just the help file...

yopla's icon

you can write applescript in max with "oscript -e"
and the shell object
or run an app from applescript, always with [shell]

jml1985's icon

Thank you YOPLA,
But what is the syntaxe? Could I copy a script with the same form just after "oscript -e" ?
Something like
oscript -e say "do you want to quit?" using "Trinoids"
?

yopla's icon

i think it's better to make an app from your applescript and launch it like

Max Patch
Copy patch and select New From Clipboard in Max.

some example :

there are a lots of posts about that in the forum ;)

Mathieu Chamagne's icon

...or use aka.power :
http://www.iamas.ac.jp/~aka/max/#aka_power
("gets the status of power source and perform sleep, restart, shutdown and logout.")

simple and easy :-)

m

touk's icon

or use the [jit.gl.lua] object, watch for the os.execute() function in a script, with "shutdown" as argument...
i didn't try yet but i think it will work