Forums > MaxMSP

Help – multi line formatted text from [text edit] to appear inside message box!

Nov 14 2010 | 2:42 am

Hi all, I am trying to get text I type into [text edit] object to maintain its full text formatting and print into a message box. So far I have it looking correct by sending it into the [text] object which seems to allow line breaks and commas, BUT.. when I dump the text into a message box it only displays the last line. I would like it to display all of the formatted text (4 lines) in my example. Simmilar to what it looks like if you double click the [text] object..

I did notice in the Max Window it is successfully printing all lines, just only the last line appears in the message box as I mentioned. I am willing to ditch the message box if needed also.. Basically I am looking to allow one user to type a question and have a bang display it on the screen later for another user. Any ideas Max gurus?

See patch below:

-- Pasted Max Patch, click to expand. --

Nov 14 2010 | 1:36 pm

Run it all into the [zl group] object (watch out for blank lines) and then send it a bang. The [text] outlets the contents line by line so you need to join everything together.

Nov 15 2010 | 9:00 am

Thanks Luke, This groups all the lines, but I also lose all my line breaks and paragraph formatting. Anyway to maintain text formatting (multiple lines) like it is typed initially and display on screen that looks the same as what I see when I double click the [text] object?


See I updated with [zl group] suggestion:

-- Pasted Max Patch, click to expand. --

Nov 15 2010 | 12:02 pm

The message box is not the best way to display text, it was not designed for the purpose, what exactly are you trying to do? You can use [comment] to display text or even [textedit] itself and you will have less of a problem with formatting.

Nov 19 2010 | 12:00 am

Thanks, I will try routing it to some other object(s). This is for a project called ArtSpeak which is an instantaneous audio podcast generator that allows users that visit SOMArts Cultural Center, SF to talk about the exhibition, and record audio comments that are instantly uploaded and can be heard online after they are recorded.. I am using Max/Msp for the user interface and audio recording and the [shell] object to activate applescript to convert to mp3 and mirror local files to a server where the recording can playback over internet.

One element of my patch is allowing admins of ArtSpeak to ocassionally change the text that appears on a flat panel monitor (text that asks users questions and gives directions such as "push the red button to begin recording." I have it working nicely with message box so far because a admins can type a question into [textedit] and then route it into a message box. Since as you know, message box lets you dynamically change the text to its left inlet (or right inlet with set command). Its behaving rather nicely to create the effect of text changes dynamically in the program, however as I mentioned text boxes don’t seem to play nicely with line returns. :(

Anyway the system will be working soon.. Opening debut on December 9th, 2010. See at SOMArts Cultural Center in SF, CA USA.

I hope I can figure out how to fix the line break issues for version 2 in near future.

Thanks for your help and suggestions. Feel free to leave more if you get a bright idea!

Nov 19 2010 | 12:31 am

comment is a nice way to go, as per the patch below. You could also probably just use another textedit, or for that matter, the same textedit.

-- Pasted Max Patch, click to expand. --

Nov 19 2010 | 12:53 am

Thanks Ben this is perfect! Exactly what I needed. Cheers!

So for anyone else following this post. Basically it’s key that you set output as symbol for the [textedit] object from the inspector palette (click on [textedit] object and press command+i on mac (ctrl+i on pc) to open inspector and then check the box next to: Output as One Symbol) This allows all of the line breaks written in [textedit] to appear in the comment block below. Dandy! :)

Dec 08 2010 | 1:44 am

hmm. this isnt working for me. also, if i edit the text in ben’s patch, the text in the comment box loses its line format. checking output as one symbol or sending it a outputmode 1 message dont effect whats displayed in the comment box and seem to just add quotes if i send the text to another textedit object. any ideas?

Dec 08 2010 | 4:59 am


Ben’s example of [textedit] to comment box is working for me. I’m able to retype in the [textedit] above and hit return (enter) key to create a new line break. After I click mouse outside the [textedit] box to finalize it is updating the comment area, so I’m not sure I see the issue your describing. Can you send example?

As for going from one [textedit] into another [textedit] I know that the [fromsymbol] object can remove " quotes " but then you also lose the line breaks as it formats the text back to a single line again.

Anyone want to tackle going from one [textedit] to another [textedit] maintaining all spaces commas and line breaks without seeing the " quote marks " surrounding the message in 2nd [textedit]?

-- Pasted Max Patch, click to expand. --

Dec 08 2010 | 7:57 am

i agree with Luke Hall

Dec 08 2010 | 8:50 pm

thanks for getting back so fast.
yeah, i cant quite understand why it’s not working for me. i get the same results except with passing the formatted text to the comment box. i built up the patch again using the same model that is working for youall. could there be other settings somewhere else in max that i need to adjust? does my patch send the line breaks on everyone elses machines? seems like it should.
thanks a lot

-- Pasted Max Patch, click to expand. --

Dec 08 2010 | 9:38 pm

Yeah, your patch works here as expected. What OS/computer mode and version of Max are you running?


Dec 08 2010 | 11:08 pm

im running version 5.1.4 on my macbook pro with OS 10.5.8.
im using max through my school’s server. Could this just be a glitch in my server version of the program? thanks

Dec 08 2010 | 11:27 pm

Ah, yeah. This is a issue that was resolved in 5.1.5. You should just be able to update to 5.1.7 on your machine. If you are using Keyserver authorization, you shouldn’t have a problem.


Dec 08 2010 | 11:47 pm

cool. thanks tons.

Dec 09 2010 | 7:52 pm

For extra credit, here is a really ugly way to go from one textedit to another while preserving formatting:

-- Pasted Max Patch, click to expand. --

Mar 30 2011 | 2:24 am

Hi guys
I have a same problem but the difference is my text is dynamic and it comes from a database, so I can’t use comment object. or even if I can use I don’t know how to show is the way i want:

It gets the message from a database that is created with php and it shows it on a speech bubble image which also connected to the user’s face, using face detection. I can’t figure out how to keep the formatting so the user can read the whole message inside the bubble.

May 07 2011 | 1:59 pm

Hi everybody,
I stepped into this thread trying to gather information about [textedit] and here I found some interesting issues.
thank you :)
About the "extra credit" [textedit] to [textedit] patch", which I find extremely useful, I’d like to ask ben a question:
what about spaces (ascii 32)? I tried to insert some spaces at the beginning of a line and it looks like they’re not recognized by the receiving [textedit].
Also quotation marks (ascii 34) seem to be "transparent"…
I’ve been struggling with this kind of connections for a while, as you can read also here: and I’m currently managing special characters from one [textedit] to another with some basic javascript that may well look uglier than your solution! :D


Dec 22 2013 | 11:24 pm


this is really helpful

Viewing 19 posts - 1 through 19 (of 19 total)

Forums > MaxMSP