project startup automatically in max runtime?

MRTN's icon

Hi, I have a quite urgent question! I am trying to let a project open automatically when max runtime crash or open... I have installed this: http://olilarkin.blogspot.it/2009/08/lingon-keep-max-open.html
and changed so that max runtime is the open that must always be open BUT seems I can't find a way to tell max runtime to not only open but also to lunch my patch / project automatically!
do some of you have any idea? (I am using a mac, max runtime 6)
thanks in advance!

spectro's icon

Not across all the details here, but is there any reason you can't, in the Lingon script, replace the Max runtime with your patch? This should in turn launch Max runtime, if the 'open with' setting (via command-i) for the patch is set to Max Runtime...

MRTN's icon

I also thought this would work, and I tried but does nothing (max runtime open, but the patch does not), I also tried to export as application and open it (.app/contents/macOs/myappname) with the lingon script but still nothing... I thought the best would have been max runtime always open (with lingon) and that it just needed the patch in the max startup folder... but this folder seems to affect just max and not max runtime... unless I am doing something wrong without knowing it :P

spectro's icon

Does your patch actually crash? If not you can just start the app when the machine boots up - just add it s a login item - sys prefs: users and groups - and set a startup schedule in sys prefs: energy saver. At least until you can work out what is not working with the other method...

MRTN's icon

This (schedule, max open at login with right patch) is already happening. ATM my patch does not crash but it must run for 1 month and I will not be in the location. I already did that I will get notification every now and then about the patch, and so on. I would just feel safe to have max runtime + my project opening automatically if it crash.
I found now a nice link and I am experimenting with what they suggest, lets see if I solved it out!

MRTN's icon

what I still can not believe is that there seems to be no way to have runtime opening a default patch at startup (or????)

MRTN's icon

ok, I had to change a bit the instruction of the previous link:

SCRIPT

make it in .sh and then execute it
(chmod +x and then the script file directory)

#!/bin/sh
if [ $(ps ax | grep -v grep | grep "Max Runtime.app" | wc -l) -eq 0 ]
then
echo "Max Runtime not running. opening..."
open /Users/stefanodalessio/Documents/Max\ 6\ Projects/YourProjectFolder/YourProjectName.maxproj
else
echo “Max Runtime running”
fi

description: this script will try to open Max Runtime and a Max Project

and then I used the shell command (with no cronjob) as in the link I posted early

hope this could help somebody :)

jln's icon

What I did last time is adding the Max project as startup item in OSX's system preferences account tab. Then I had the following script to relaunch the project in case it crashed (actually, these are an old version of the script that i didn't test recently but hopefully they'll be enough to get you going).

--launch.sh--

#!/bin/sh

defaults write com.apple.CrashReporter DialogType none;
open -W -a "/Applications/Max6/Max Runtime.app" "/Users/Macmini2/Documents/myPatch.maxpat"

then the following task saved in "/System/Library/LaunchAgents/com.myName.mylaunchd.plist".

Labelcom.monInstallation.mylaunchdProgramArgumentsmon/path/avec espaces/et/sans/guillemets/launch.shKeepAlive

Hope this helps
Best,
Julien

MRTN's icon

Thanks Julien, ATM it all seems to work with the approach I posted, but I will definitely save yours as well for future projects!

MMa's icon

are there any news regarding this matter?