Best way to save user-inputted [textedit] data inside a bpatcher abstraction?

Danny Fratina's icon

I've got a bpatcher that includes a [textedit] box. The user (me) types some info into it to help initialize the rest of the bpatcher. I want to make it so that when you save and close the patch and reopen it, the text is still there waiting for you. If you alter it, it saves that new text for next time. Currently it resets on each reopen.

I tried using [pattr] but couldn't figure out how to get it to work. I also considered [dict] but still couldn't figure it out. What would be the best way to do this? For whatever it's worth, I can easily add an inlet and/or outlet to this bpatcher abstraction, I don't mind hooking things up to it because the final shipped product will be in presentation mode and the text box will eventually be fixed and hidden away from the final user who will have no need to interact with it. For this reason, I was hoping to avoid a json file just to keep file sprawl down, but if that's what it takes I'm cool with it.

Any suggestions? Thanks in advance yall!

Jean-Francois Charles's icon

If the final application doesn't have a [textedit] object exposed to the user, you could use a message box.

Danny Fratina's icon

As I'm working on it, I can expand the bpatcher to see the [textedit] object and make adjustments over the course of the project build, but at the end I'll simply reduce the bpatcher window so it's no longer visible. The message box is surely the simpler solution but I like the [textedit] option because it's less finicky. The message needs a specific return to send it's data out but textedit always works even if you type and just click away. In theory this would be the better way to work on a project over time—in fact I made the switch because I kept finding myself adjusting the patch as I went along and finding that the message box hadn't send any data.

At the end of the project I wouldn't be opposed to hard coding everything into a message file with a loadbang, but I do like [textedit] for the time being. Happy to be convinced of a better way though!

Source Audio's icon

Embed bpatcher into main patcher.

It will store textedit items

Danny Fratina's icon

Perfect easy solution, thanks Source Audio!