Store changed values on quit without external file
I’m probably overlooking something really basic, but is it possible to have either pattr or pattrstorage retain a changed value on quit without writing to an external file?
If you save your .maxpatch before quitting Max , pattr will keep its value. Make sure "Restore Saved Value at Patcher Load" is checked it the inspector.
If you open the following patch , the number box should display -55, which is saved in the pattr hop instance.
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 339.3ockREsaCBBE8Y7qfvy1FQicI6CourzXP4tVVTvfXW2Z5+9fqnqcoYq6 Awv4b3x4d3dNgvpMmfAF8Y5KTB4bBgfPA.RbOg0IN0zJFPYL8XWMXYoSTGEV snCtCiemR2BN7T7HnRhJM0usp3JglQ2rx7H5qFsaP8IVYd95rH7jR2G8vjmY JsikRY0B8dFcWTUuv0bPo2WYgF2jPd9FeQn7mJB+JyBq470YKmIbgKsxVvJE ZAKPcIIIrj9n4C7tu8tW9bvzOC6fSnuBN0YoWw7WwF+9wVw+L1BYF98qYVVN lYEXZsYyikYQNKL3L138sprb4PChifrx2K96oJz9p5Q2zLHYISC9w5qrCrUf VT2hEJC4vGj4mErrrVk9mSwX+Dvu8sZvLZalSgXfR4KlS5csRKbJi9JM9YU5 2c8AkTBH8b71oj8F+jXzBzc2XvjKIewGEzru -----------end_max5_patcher-----------
Thanks, but what I’m trying to do is have it store without making the user save the document. I’m working on a standalone app that I want the user to be able to enter some information and have that information retained for subsequent launches of the app.
Reading your request literally, I don’t think there is a way to do this *without* writing to an external file or modifying the patch, however it is entirely possible to automate the process of writing a preset file so the user does not need to be involved.
There’s probably be a more elegant way to do this. This example requires the manual creation of the preset file in the first instance.
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 664.3ocyWssbaBCD8Y7WgFdl5QW.LtO09czIiGgQ0QY.IOfvwoYx+d0EvFWW iINDhe.XztKhydzYWIdclmepbOqxG7cvu.dduNyyyZxXvqYrmeAc+5bZkMLe A6YY5S9ANWJ1dk075bYEKkJ1z542RgRPKXVu+rjSya8HpK3hblxNevNgWw+i MbDbN7XrxZUavnFqNSpW1xbH229gAOz3dKUs9QtXypR1ZkKBLNQOm.DFadDE aGnMc3c3YVfpSsugP9FauMal4Vv.4kBVUEcC6LhoRIKY.z6jVviBsbEJwwBg VlIDYGDeAJAdKTxEjJYrb5KfHH7KgStpTAE2HUHVoRXeRkkioR4NTifhW5zH KLOH34QWVijLhRjbIM6FZlflVEBDZUH39THKFSExykbE6NTkz1II55pj3wjO zPflmeW1b0pPvHGwfB6q4Z3MU3TWjxJaSuczxC48od9LpbvWhR3Bkev.JfBI 1JGjqzIB1WAD4i2VoK6rilWetPRiQUI3DeeFDG4hZoflq9XMRLwwZtMlVzGq gaAaIyd.jlB0Hxgfqn6XYqzwpm+UlzmmVqbGEz6.qZvQolDTrxULAMM2NQPq O6Rx3svPqUx++5hIAzU+.SDfeXvcgLiAHeIaNbkFgMmVv8n+yNbnqkIu5rLY GO+oJoveDVpB55jK3JC2chmF5sSZDkPB.wIlc3Hg56Kiawum9b9blP0sVVe1 Q8EIxD+BL3gyEG121OmK92+zvRgF6mpXpj0kqaIb2wrB.G4vLMWwETEWyPGi I4jXdjmkwDc+AiBd1VotAUCDb37L06PQTx.PDZRQzhAfnkSJhhu63Hx.PDdR Qj4qgtBhHSJhPngrrAmVLAu6jRCgkBOYw88gH8f2l8W.G23ED. -----------end_max5_patcher-----------
Try storing your values in message boxes (prepend set >> message box, or use the right inlet), then on load, use a loadbang connected to the same message box to pass the data along.
It should do what you want…I think…
oops. drr. yes, it would. i thought i was being so clever ;)
/I’m to tired to make something with it right now
Couldn’t you save your sensitive datas in a coll or text file with some encryption algorithm, and decipher the file when needed?
@AudioMatt: is embedMessage a 3rd-party external? I’m not familiar with it.
@Patrick: coll was actually my first thought, but I couldn’t get the data to stick without either saving or writing to an external file. It’s beginning to look like I need to explore some sort of data encryption as you suggest.
You can’t avoid the encryption. Collective files and even standalones would also be readable with a normal text editor…
Forums > MaxMSP