Is there a way, and what's the most reliable, to do this in Max5/Leopard/MiniMac?
You could try the aka.shell object - the easiest way might be a short applescript that performs the shutdown operation - otherwise I think you need to be the superuser (to do it directly through terminal commands).
The command to the shell would be something like:
osascript -e 'tell application "System Events" to "shut down"'
Although, I haven't tested this particular script. Note that if there are any unsaved documents etc. then I don't think the computer will actually shutdown (as in the case of choosing shutdown manually)
AlexHarker wrote on Thu, 05 March 2009 14:22Although, I haven't tested this particular script. Note that if there are any unsaved documents etc. then I don't think the computer will actually shutdown (as in the case of choosing shutdown manually)
Using "shutdown -h now" as superuser, the shutdown procedure won't be stopped if there are unsaved documents.
poul wrote on Thu, 05 March 2009 07:10During my research I found aka.shell but it's for Max 4...
Most objects do not require specific max 5 versions.
I am able to run aka.shell here under 5 (just using the test file) and it seems to work - unless you have a good reason for believing it is not compatible with max 5 then I'd assume that it is until you find otherwise.
Looking there - Have you looked at the curtains object? (again - I'd just try the 4.6 version and if it works it works. Generally UI objects and objects doing things with files are the only ones which needed to be changed to work in max 5).
Actually, I'd recommend looking into Keep-It-Up for this. Aside from setting automated startup/shutdown times, it will restart your Max patch in case it crashes, keep logs, send you emails with status updates on how your patch is running, and a bunch more stuff.
If the shutdown is to be triggered remotely by MIDI, you can have your Max patch trigger an AScript (with aid either of aka or taptools) or other message to KIU to execute the actual shutdown.
I have no interest in KIU other than as a satisfied user. Last time I looked it cost US$22.