Save the patcher function inside a standalone
I built a standalone app and would like to include a function that the patcher saves to disc at closebang without having a Mac dialog appear.
The idea is to save a few data in the app each time it is closed without asking the user to save it.
Is there any command available to do so? I checked the complete browser but cannot find any. Is there are workaround to get there?
Thanks!
You'll need to save stuff to the standalone's preferences folder.
Cheers
-A
Hi Andrew,
thanks for your quick response, but please forgive my stupidity:
- my app does not have or create a preference folder, or at least I cannot find it. Where would it be? In user/Library/Preferences?
- and how do I save to the preferences? Sorry I've never done that...
- is there any tutorial or so?
Thanks again
this
https://cycling74.com/tutorials/get-your-max-standalone-on-apple%E2%80%99s-mac-app-store
has information re mac but I think you can apply it to windows too
You can set a custom name for your app's prefs using the standalone object, in its inspector.
Then you do something like
to get the path to it, which you can use to save things. In general, users do not have permission to modify apps folders.
Cheers
-A
Thanks Andrew and thanks to Floating Point. That solved my problem, many thanks
Sorry Andrew and Floating Point, but the problem is not solved yet. Yes I can create a folder in "~Library/Application Support", write a .txt-file into it, but I can't read it out, because the separation of the two words "Application" and "Support" makes any "read" command to the "Text"-object assuming additional arguments. When I make a symbol out of the path, it cannot find it. How do I access "Application Support" from within a patch?
Thanks and sorry for bothering so much.
you need to enclose the file path in double quotes, for example:
(read "my mac/Library/Application Support/my text.txt")
you can use the tosymbol object to help with this
Hi Floating Point,
many thanks, in the meantime I found it. I just made to many trials, so that I got confused, I had the solution already, but did not see it, due to over concentration. Sorry for bothering
Many thanks again and have a good day... Hans Peter
Is this method effective for macOS: 15.1.1 (24B91), MAX 9? I tried it and it didn't seem to work.