Deleting folders from within an app
OSX, Max 7 (currently still 32bit)
So, most of the references to this in the forum are several years old. I've been using jasch's fscopy, but that seems to have been deprecated (it's not in the current distribution).
I also found an oldish patch using the [shell] object & [rm "folder path"], but I can't get that to work either (which _may be operator error, as I don't really know what I'm doing with shell)
There's also an oldish mxj object, but I think I've used that before and found it tended to crash my patch.
Does anyone know of other ways of deleting folders from inside a patch on OSX?
thanks
David
Shell would do the job perfectly, but You probably have a problem that either:
1- You don't have privileges to delete that folder
2- Folder has items inside, and can't be deleted using only rm,
but needs rm -rf to remove it recursively, in simple words kill it and whatever is in the folder.
Another thing is forming a path for the shell.
Simplest way is to insert {conformpath max boot} between the absolute path
and message {rm -rf $1} -> shell
That would format a path like :
"Macintosh HD:/Users/User ABC/Documents/Max 7/Library/"
into :
"/Volumes/Macintosh HD/Users/User ABC/Documents/Max 7/Library/"
--------
In case of folder that needs admin privileges to be deleted,
message like this needs to be used:
{echo 'pass' | sudo -S rm -rf $1}
'pass' should be the admin password, like ' ha ha ha this is my password'
P.S.
Jash has filemanager external in new distribution,
which can delete stuff.
And fscopy works fine in 32 bit in max 7
Thanks for that. I managed to delete files from the desktop (once I'd set permissions), but couldn't get it to work in the subfolders in Documents. But never mind - I'd somehow managed to miss [filemanager], and it does exactly what I want!
Thanks for the info and the heads up.
David,
just curious, could you send me crash reports of my oldish [mxj filesys]?
Hi Patrick,
I'm away working this week, and if there are any crash logs still around, they will be on my older laptop. I'll have a look next week when I'm home. From what I can remember , I was getting some kind of occasional crash, which I somehow traced to the mxj object. At least, once I removed it, the crashes went away. if you want to email me directly, I'm davidestevens at apple's email service.