How can I empty the clipboard?

Jan Schenkel janschenkel at yahoo.com
Sun Nov 17 14:45:01 EST 2002


--- Andre Rombauts <andre.rombauts at win.be> wrote:
> Le 17/11/2002 17:42, Jan Schenkel à
> janschenkel at yahoo.com a écrit:
> 
> > There's no real way of doing that as far as I
> know.
> > Besides, it's not really user-friendly is it?
> > The question is: what are you trying to
> accomplish?
> 
> Just set the clipboard to "nodata" when starting an
> new session in a text
> editor for students. I would like to prevent pasting
> text format no
> applicable in my editor. No problem to prevent
> pasting an image but if I
> have RTF text in the clipboard instead of pure ASCII
> I have no way to
> prevent pasting it...
> 
> André
> 

Hi Andre,

How about this in your field script:

on pasteKey
  send "plainText" to me in 1 tick
  -- strip of the style elements after pasting
  pass pasteKey
end pasteKey

on plainText
  lock screen
  -- strip of any style elements from the content,
  -- thus leaving only the ones set in the field 
  -- itself or in the runtime environment
  set the textHeight of char 1 to -1 of me to empty
  set the textFont of char 1 to -1 of me to empty
  set the textColor of char 1 to -1 of me to empty
  set the textShift of char 1 to -1 of me to empty
  set the textStyle of char 1 to -1 of me to empty
  set the textStyle of char 1 to -1 of me to empty
  -- possibly a few more, you'll have to check
  unlock screen
end plainText

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com



More information about the use-livecode mailing list