--- H Baric <[EMAIL PROTECTED]> wrote: > Hi all, this is my first post. Hope it works! > > I'm making a very simple Text File Editor, based > pretty much exactly on Window's Notepad, for the > sake of learning. > > I've been trying to find a way to set the Edit field > to non-formatted text when copying and pasting text > from web-pages and other applications for example. > > What would be the best way to ensure that the > editing field cannot be formatted in any way (like > Notepad and other basic text editors)? > > Is it possible? How (and where) would I script this? > Thanks in advance :) > > Cheers, > Heather >
Hi Heather, Welcome to the Revolution community - you'll be sure to receive lots of help as you're getting to know the product we all love. The one-line solution to strip the style information from a text field is: put the text of field "MyField" into field "MyField" Now, if you want this to happen whenever the user pastes more text into a field or drags-and-drops from another field or another application, you'd have a script similar to this: ## on pasteKey send "StripStyles" to me in 0 milliseconds pass pasteKey end pasteKey on dragDrop send "StripStyles" to me in 0 milliseconds pass dragDrop end dragDrop on StripStyles -- save the current selection put the selectedChunk of me into tSelectedChunk -- strip the style information put the text of me into me -- restore the selection select tSelectedChunk end StripStyles ## Hope this helped, Jan Schenkel. Quartam Reports & PDF Library for Revolution <http://www.quartam.com> ===== "As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld) _______________________________________________ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution