jeremybernstein / shell

Max object: execute terminal commands on OSX and Windows
70 stars 7 forks source link

Shell doesn't work on startup #10

Open randallpacker opened 1 year ago

randallpacker commented 1 year ago

Hi Jeremy,

I am using the shell object, version 1.03 for text-to-speech, Mac Studio M2. It works fine, except when I first startup the patch, I have to unlock it, and retype 'shell' in the object before it works. Perhaps there is some kind of initialization I am missing? The patch is below.

Many thanks!


----------begin_max5_patcher----------
973.3ocwWszaaaDD9rzuBBdJEPgfy9d6s1BjCs2ZAZOjDXrxbiDMnVJPtzwN
A4+dmcIEUrDksrsPxEBOyNdm46amW5qymktr9NaaZxul79jYy957YyhpBJlM
HOKci4tqqLsQyR2XaaMqroK5OyauyG0+A7Oa8ICG+gzcFrsw1Zcdiur1cUi8
Zeuy.dlVP3JMPE4JFQPVjnAQlhPXD7ifIy0L4hDfQxxWjP3Y4Ieb3NKKhtrd
4MuEHho7T3bXPuqaSoqx5iwOYmwF+0qKcq9tPhn3YjbllJALpnBNfwDOmJx3
RAgp0LJOmQozoCJzM0c9c9Ymy6U4ueqs2IooIeLbx2lOO7YwYx5K67dDUSfe
JYD+lFyFq21bk0YVVEcX9Tb.bZN.v2ENMWBLNgnUZBQE3.sJCTJthI3bRtPp
EH3YQJf87ofkF2pWFM3reFA8Q4dU0lhPhWhdJFhqRuHr.lolwzXZImBBJEzR
MlIjm+iMS3DTfOYYR6TnWNh9OU67skeI5dHj+9HjRvVGlMEum+01TXblzmco
iJOivz..Lfp4bgBoQFMxWzSxWjGMsYwEl29RUxM0kSUYQfmEyQtjLGnXGyb.
RmbFHPazBFnjgdluDh7hShXm2sVWQRq49j2d6TbIA9okEhcHwxVjKI.QSPFk
fMu.AN+gqvpXrklD0ReTp7BWC2sw55ljlDmSybSUU8mKZLqtbc3ArCuVIXbY
tTSoDlPdN81n6vf2tYXKhzeqZoswGxwVD976l0q2KXqpZ2KgEdq1K0sDw49S
+Cz158h+kwu99Qo20XKFE9yNWYcyn3eap1t2k+iYiw4WaFU7eqKa2ZaRGgzQ
OpktX3ewKSZWiPZpmc5OupCBmebmFk7k1iNvYCi2GLo0bqs3JDlXfbkw6aJw
cY5W4b1H8MafaBH4ME1OY5p7+RZ7nH0u6AHdqoUktC2YMh2f9G9pzV20b8tX
arodxdXUf6rV5FWY78e2CRvpIe6OaeEplSfmxWD3AQzlxhsXcge.fgFUGWtR
n73KjLVfdnHP5e+zrL4wsCCG9pQFbNr3Nt9U4q3BLOsuhb8IYwSPEfJxSDdO
scfnJtfKDDOteohkcYPFbVrHbJjQwfdBjkKlXyKdPoPjSnJoDWjWxl1zWKt3
OqWrWmuB+7mmzWiQzqyWGjicBecP95YkIliUtL79kbgTIo44.r37M8A3puEo
Y61asMsCgVDR3HpavojnnZQTrz0KxihM1aK2YeuFSCNBwiss6Z5mwbmfk1+u
VWXabckwoQyCjI5x33uv7n1slddKNkb92l++7+AuIA
-----------end_max5_patcher-----------
jeremybernstein commented 1 year ago

I'm afraid that I can't reproduce on my M2 MBP. Is there any warning or error in the Max window?

randallpacker commented 1 year ago

Thanks Jeremy for getting back. I have this problem each time I open the patch: I have to unlock the patch, and retype some portion of the shell object, and then it works. I have the shell folder containing externals in the Library folder and tried moving it to the package folder. No luck. How do you have the objects placed in the Max folder?

jeremybernstein commented 1 year ago

Hi Randall, mine is in the packages folder. Which version of Max are you using? Have you tried removing any quarantine attributes on the object (Max might have offered to do this already, depending on your version): xattr -cr /path/to/shell.mxo from the Terminal

randallpacker commented 1 year ago

i am using the latest version of Max, testing on a MacBookPro M1, Mac OS Ventura. I tried this script: xattr -cr "/Users/randallpacker/Documents/Max 8/Packages/shell/externals/shell.mxo" but still no luck.

jeremybernstein commented 1 year ago

Hmmm. I honestly have no idea what would cause this, but maybe there's an issue with Max's permissions (like, it can't read out of the Documents folder for some reason), or Max is running in "Translocated Mode". Can you please confirm that Max has full hard drive access (or at least docs folder access)? Also if you go into Activity Monitor and click on Max and then on the "open files and ports", can you please confirm that the Max binary is running from the /Applications folder? Thanks, we'll get to the bottom of this somehow, but it's pretty mysterious.

randallpacker commented 1 year ago

It is rather strange. I've never seen this happen before with a Max object.

When I ran your script, it did ask for permission to use the documents folder, which I allowed. I just gave Max full disk access, and it looks like Max is indeed running according to Activity Monitor:

/Applications/Max.app/Contents/MacOS/Max

Many, many thanks for your help!!!!

jeremybernstein commented 1 year ago

Just to confirm, even in full disk access, the external won't load? One more thing to check -- go to your File Browser (in Max) and search for 'shell'. Maybe there's a patcher, or an old version of the object which is being found first for some reason?

randallpacker commented 1 year ago

I agree, this is so strange! There is only one copy of shell.mxo on my computer, and in fact this is the second Mac I have tried with the same issue. The object does seem to be sort of loading on startup, in other words, it's not greyed out. However, I need to type into the object before it works. I have restarted my computer...

An interesting note: when I open the help file, the Shell object is working, in another words I can run a script and it sends out a bang. However when I try and run the same script in my patch, it doesn't respond at all until I type into the object. So it doesn't have anything to do with the text-to-speech functionality, the object just isn't loading properly.

What a mystery! Again thanks so much for your time and attention!

jeremybernstein commented 1 year ago

Please send your patcher over (not the contents of the patcher, the entire patcher as a file). Maybe there's something about the file itself... :-/

randallpacker commented 1 year ago

I figured it out (sort of...). I was perplexed by the fact that your help file worked, but mine didn't. So I move dmy patch file into the Shell package folder, and it worked! So there is something weird going on in the folder where I was storing the file, which is a package folder of my own, which has a lot of files, but nothing called "shell." And there are no error messages!

randallpacker commented 1 year ago

Many, many, many thanks.

randallpacker commented 1 year ago

PS: I remember when you and Luke Dubois were working on Jitter in the early days, because I was heavily into nato at the time, and one of my students at the Maryland Institute College of Art was Wesley Smith, who I introduced Max to! And just to give you another historical note, I was working at IRCAM when Miller Puckette and David Wessel were giving birth to Max. Have been using it ever since...