Hi Jan, Thanks for the one-liner, one to remember!
I tried to drag drop text into my field from other sources before trying your script, and it works! So would I still need to use it and why? In a standalone will it still work without the script? Thanks for your advice! Heather ----- Original Message ----- From: "Jan Schenkel" <[EMAIL PROTECTED]> To: "How to use Revolution" <[email protected]> Sent: Friday, August 01, 2008 9:43 PM Subject: Re: My Notepad Style Project --- 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 [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution _______________________________________________ use-revolution mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
