My Notepad Style Project

Eric Chatonet eric.chatonet at sosmartsoftware.com
Fri Aug 1 04:47:06 EDT 2008


Bonjour Heather,

Welcome to the list :-)

First you have to check the clipboard contents to accept text only:
if the clipboard is "text" then...
Then use the clipboardData["text"] that is unformatted text:
put the clipboardData["text"] into fld < Edit field>

To handle the paste shortcut:

on commandKeyDown pKey
   if pKey = "v" then...
   else pass commandKeyDown
end commandKeyDown

You can use the pasteKey message also but it will work in a  
standalone only.
Last but not least, you'll have to struggle with the selectedChunk to  
paste at the right place or replace some selected text.
Good luck :-)

Le 1 août 08 à 10:27, H Baric a écrit :

> 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

Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list