How to properly load, edit and save a text file.

topher6345's icon

I'd like to build a text editor in Max.

1. The user loads a text file

2. The user edits the text file.

3. The user saves the text file.

Max Patch
Copy patch and select New From Clipboard in Max.

Somewhere between the output of [textedit], commas get deleted. How can I save verbatim the contents of [textedit]?

The practical application of this -

I'd like to be able to read, edit and save Csound files all within MaxMSP. Currently in between editing and saving, commas are stripped out, and the Csound is syntactically invalid.

Csound files are text files.

Current Csound has a number of frontends, but since I use it so often with Max via the [csound~] object, it'd be nice to edit the files directly within max.

leafcutter's icon

Think this might be a bug, notice if you change 'write a.txt' to 'write' then you have to enter your own file name but the commas are retained....

topher6345's icon

Think this might be a bug, notice if you change ‘write a.txt’ to ‘write’ then you have to enter your own file name but the commas are retained….

I couldn't replicate this. The commas were not retained.

Could the filetype message have something to do with it?

I've been sending [filetype .csd], I'm on OSX.

Max Patch
Copy patch and select New From Clipboard in Max.

Heres a more fleshed out version of the patch.

seejayjames's icon

Do you need [textedit]? Can you just use [text]? There are a lot more features in it and I don't think the comma issue is there either. But it does require its own window.