Help – multi line formatted text from [text edit] to appear inside message box!
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:
----------begin_max5_patcher---------- 989.3oc0X1rbhiCDG+L7TzqurWHtrD1FyVyk41jplceAljZJgcGh1wVhxRLj rSMu6i9vjXHlM3DCIyE.2RVp0u9uT2heLdTvB4cnJ.9K3KvnQ+X7nQNSVCiZ ddTPE6t7Rlx0sfbYUEJzAS7sow6zN6ZIjWiLMBLnjKPXg4oussah0Ux05RT6 FjnFq2HEZAqBcCvGq4rxfVsn3+mqEBMb6KrhoyukKV90ZLW68Z5rYllgotOI zD6WznvH35GmZtX6LSZLxKbyobw+dAIJvZ6miGa+XxqDC40OyRtd4BuiSrdZ TyGyhSHSrldvsOLaryUtrTVeziyQRxjjGIIcZuA47gjivUWM42VRlk0BjjdC xrgDjl8kEb0pR18fsKLfIJf0J7zuyjD0BCj3rdygYuDNHvMl28IXXUM+Q3bB WyjX2xLataoG260b5PF6+jbCjyDvkvRTCe7yeFz2hvMx5JlViEfsivM0xJfs P9cDLZE1pUHqF3Beil4EVfkxMaGa6Q64x0B2DPO47bZhS1D6kRTZ5Vrdz.MY HA5+H07b7ozA3ZPJJuGTnnP4nrYrztDggvkB3uY2Aa3hBSWuWt17yxRSeQ66 4TlJfYrX6tB1bK1L9FNf7ui9ArXc0J+VXQQXmgi3yP3vqnaRyRcp7TZOBGwC Y33CWbATHWunDg7Rd92rBXKU2Sg2b9mxPuZ6ZwDm3BEu.guXa+52HsMYpmhI tTNj4Y8VaO8k.yJToXKwNz1a7EtEGFFBeBKWAUnWcZDmf7FiJjq1msN4+ez8 Aqa8XuI88qP+BOH3HxM26rswNLFO2AUR1gvHsiJ.Gv7LEnMSKIJpmHYASrbX wBsoxC+WoOS8bcgERxPpurme8lpSHyRaAjXRu0IyFz8a4klDsuo.glk0BHM0 o0KfPGvcNtezINldPbLoYii4aa4cmfiUn95ViS6e0quniUVrVqkhW0gGcI8S nshzzn9WV57ALRWaV.Hb33M8+KdeRBxMmQ1+qpk9hBx1kNVv6nfcr1TSnoXP PY7SSYMtDxlqB6t0lRZRHWIMcQJ7sPBg7Z3JgM28k+Y0C1oM1enwWah8Nqyz J6pjEXa1rajL9I2UOJjDmDMOq0criBmNKMd1d211UP29idmJB2E6NdwwdW5+ ncncDUwOunxmwMdtOOSbutyxN+C.tWyEA16OpyM0V66J0Tx004aATyIQlE0C ydApzbASyMmy7XmR2oO2xKJPQ6Jdq3Eqj1ap3eG35N08CpKQNqtjA5GAkdO5 SyOq9T5wD5lcd4joPj2e9zz2e9zdRkCrsyT2+4zo1e9N.ol9JbJyC+b7uTm6 kmA -----------end_max5_patcher-----------
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.
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:
----------begin_max5_patcher---------- 1064.3oc0X80jaZCD+Y6OEp7Ralw2MrRBvzoyzIO1W5Wfb2zACJ9TNPhAj6c 9xju6U+A6X6CmBDNB4AafUBzt+1eq1c0mWtvai7YVsG52Qe.sXwmWtXgUjQv hlmW3Uj7bZdRscZdB1SxMexakaHE6YkUbkbmhgpYpCiH1UnEkyT1WC2H0IRs uj4VSOuU5en6aF9iRgRjTXGz68U7jbuSFol+hcD.eqei3xDU5Cbw1+ohkpbe RrOQOLhPolKAQl+w925ebQzZFWbPwfFg7L6ZpMsav9dFYeY4Ryeq5HtTvpqS 1xdEvnX0JD..xdCFic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Tmhm1vtt3 5hf4GEep0Ix7Sm51VlS8dlcJ4Rz2yll5G9xx+CzgqGyO -----------end_max5_patcher-----------
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.
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. http://www.somarts.org/
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!
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.
----------begin_max5_patcher---------- 488.3ocyU11SjBCDG+0vmhl9pyj0MTfhK2qt6ywowzEFcqAZIzRt0y32caG. k000v5dZLgzGlos4+7alVdHLftVuELTxOI+gDD7PXP.ZxaHXXd.sVrsnRXvk QKz00fxRWz6yBasnc6Fog39zJfTIcM5aHdmWpF8HTZ6Fn8RkPUd3IiGr+LJz cJ7z4CFUc05NaEXQsDMXUVhJPu9tyyG295aKzU519HKZIOhkmwV3FEmviyS2 cD2OfQtZXu2nUVknFvS82sRQEchGi7enmjrkQuHKoZTUrAiMBawFo51qagBa uNXb2VHr7He2EoXWLKYYD4J+ddLLz2r3jyD.ovITmOyXV.JkVL6zYa5rDgKa PL2WuVWQ9wu5MVqKAB6L5bQ8J5QgKV7wiKDP8PKIMEoUzGDVJ3uNQuGqZZgF vUAZ.6aG3r8C7rwU1uL68MPudozirD5ivj9RnrgRnOClz5hK.qZdajDuOR3G FIK9JwRBhkL1Igkw6KeGdhKceVydWVK8OHLer+xU+o.9+RxHEai498SVwdUx .0FRfW82G77712MCYzcsEiA5vsPRzyQXIXrRkvJ0pIqIem0rQVVBpoulUKKa zNhMHg3zkbWQzJraxjCTEMWkxmgRyNNkdhJhMCEwOAE4l7X3SrJPEDA -----------end_max5_patcher-----------
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! :)
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?
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]?
----------begin_max5_patcher---------- 620.3ocyV1rbZCCDG+r4oXGcpcFJik+.r6o1miRlNFaQPs1RdrDSHMSd2qzJ SgP.rSASxEizpEoU+z9WqdZjGYgbCSQfuB+.77dZjmGZxZvqsuGoJaSdYlBc inYazrBtlL1MnsONvbRlPpWwZ.1lrp5R1bwCb8JPUmkyTPlnXtnjKXvhFV1u UyIamAqwb4ZANMgsFkq0kLs9wZlK3LdCDtwmwtlD3tVO4E3xKW7quDP2NmKk BsHqB+yju2vyJI6l3505JYANFs0pXcEWXVP09FsShh+GmiAS7aMWmoyWwE2+ yFVt1EcgoQlggTe62v3.rCch++BRy761Q3BDYM97nQ1Oi6I2ErGLawWQ85FV MST.JllbRzcTV42MqtPpPmY4PfO9yrHWmSBE5G.nPSGbnDlFhfHHYvnxIknG HPgCzmvdxSxknCoyd2zgHUClFeyEhKajUpGqVHKei5vjqQJGcRbZLMYVmWQE 3ioeSSFf7tbYUESzYZ24qKb1pBKtOWVJab6H+Iw9zzozwlVAly5znW1J11fd LleMT4gSO6Ues4goXdni1zvSmH5eEwsg0PtIRMio.4RX60A.2zEUcPlg6fKa E9z21IEA5mIuFWICekBrvI0oZi55NQ+qmpswLsLjPm8BuipbiGdrD4vxTTxR 6.KACXohKPy9+UA4cp.BNJDgoiAtxGI8q7A5BRfCdNMtJV6u7XPIW2juEIae PFrakJXJMWjo4Rw9NQegSq3EELb7s6oJdQszP21f.t6nIE8MlruGpyXxVs+F FS8hSo2zPJtOmb92VJkzmStOfXJ41lf2iPJ9BhHSmmG8W7.anxB -----------end_max5_patcher-----------
i agree with Luke Hall
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
----------begin_max5_patcher---------- 684.3oc6VErbaBCD8L9qXGN65AAFabuzoeGkNcjgM1pFjX.w3jlI+6ckDDbp iigVOYxgdAPqVs6SOd7DONyyeq5drwG9L7Mvy6wYdd1Pl.dci87K42mUvaro 4WhMM7cn+b2bZ7dsMtpUW0pKU4Hv5mrhqy1Kj69QMlocMgsd4hf4Pbj4Zh8Y Vxh.36cKQ1VJjEn11rvtfhbWK19yOspu12ojZIuDsy70ZAuvenDDX5qAqKpK j9gJzADe+m6ooTMheYmfEtHvD8oYyLWlORVISUVhR8YrRiBNtmqgbE7fpEzD ab.NJJJrCOppO7EP.YboFZPrDzJ3.hUThHbmptjqWPE.kTRT4wZvTYfKygrB Q1Af1Uf5Na5lYvbgFHjBzMN0j5VYCUycHkPsMxyCDvwZgFsKkvQdCrmVjYjq Qaa0Zkz1JsA.m0OSanjfFsY6vgsEprC8DPgPhYpVokE1bY4PbfQArLdkUH3F whXWRPvNWPrYpBhfa2acGG8Vp8kICp8vf9qidysdhZ5sb4NRW+eA7sU.G2Eb 6tLUgp1Q1AKRBWuLlM+Ue5TI7qJLVaDCQQVGvnDqLYSxDjFw2Dc+p+JcuDOR P3LsRUMVgDc2fZ+qu0CXlatiClzGEQeLOB3BjRM0Um195bR3ZqQwJ1j4jvox IgWjSlei4k9OqGk0Rpr2agdxXtjJOwcIUdp8RpryfgRc5NLTgGrXLEtyVIUR AGFa5+e3yjJeMiFZcukSSpbbVMrUWUkj3NGg4NrLYJGVxlpLY4aISDlyKtlh Yn.c+dnchSzQ1UZIg+3+PsLfI9KEWMp15rdXz8Kgv.EjiDIK4ZAcv7PNrWjy dQdNJO0TrTjWon8SGDtvQniEQgi.QQuqHJZDHJ9cEQrQfnv2UDs9CmNZLu01 7OfHZvSy9MvfheIm -----------end_max5_patcher-----------
Yeah, your patch works here as expected. What OS/computer mode and version of Max are you running?
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
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.
cool. thanks tons.
For extra credit, here is a really ugly way to go from one textedit to another while preserving formatting:
----------begin_max5_patcher---------- 895.3ocyXlsjhBCEF9Z8oHEWaaQV.g4t44XrqoXIslofDJHTSuT869jEvVsc AEL0biPBGfe9x+4bP9X9LuTwqzFOvO.+BLa1GymMyLkdhYcim4Ul7ZVQRiIL ON8uhz+3svdHI8UoYZlTjzOonUVPkx2pn1KrGiqB54ti9hfKaXuaNFDszua5 pDY1VFeyuqoYR64gBTGEfC70aHg5eQp82ck3skLt5NYDF9qIs2eyrvtYY4FU pT9SwDu8TBOoznDueVyRJ7zG3y4y0+rXb.4kZQYyakohhyhk6gIqLLg.MLYE 9xLANXlfcBSjfX.zGjdQixhcaRS3aFguAZ1D.uGFgOAiPNgQOhDIqoAGMwIR Pm.jjpJJOW4alz7HqGAY2DtZhxihhcBRdu.roVzVcdhrXLUW5p3FbEpfNIUP mfJQNkJ.3jykN2Rf0sfmJtD5DtnXhjdw7mwQkHKUhumbnSQE2zKJQJXmkHEr lQ7FKv3fIsPajui5NW.xJnI0WznXi39YCw1DZpbKX2zUtplZ5BYaF8.5DQrb INZh5DAmXOSZqTJ3m8A+vWU6BUP6e7llWa8ddRzqozbl7aqwao0T.qArlCVK AMhRJnrsPxdpfwocypCdInRAC0iGPtUEtTrgJUmKfwAh5b0NRgJtFY2oTSks 07lEfLQYYhZahxG0TkjQaVZCoWI56SlnkajSvkRB6dA4iJbWuI0Fi+RLI1Gs PsCBGfhI587ChhPp8f6g8zMYhBQc+YEniEpCdUPXTH1rGdkpu2gm19laDYm4 VCmCtdCTEmOon6e6DCskNH2lig7cGCB5vVtlgOlltvUlbnP3DUFMXZwx0xwV yOJ8ZM+VxrVyuTR0ISmH2b5jJRkZJE4z8I4stPEzU2SGJHBNZC7.8ul6hg.G 8wcLBUO+gqdMh15rdjz+NGfuDath5Ldhjo5ArWPwGDzVVdN0b7drTxxqDJ51 IBvymzKMTMo60CfWQS5L7aQSgjk5pag1zJyxzACHglWiCaByLXJdJtFYCbJX gCPQGI6GsjhGxZs9S44ZMgtVNQzM5+B0FKLwVffravTnU++u3m9e1ccM4Ve1 QKWmQSP25yFBmf92llrVKBtygsavX0J4An0wpogTO6HH+n0TvPZm5VLAGRKd jis9CwM41BDCQR5ujmK0T3PzD18E2gSbyw99gv8aNBOp4nZvmy+GlWNpq. -----------end_max5_patcher-----------
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.
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"…
this is really helpful