clipboard issues anyone?

MisterX b.xavier at internet.lu
Sat Oct 28 04:39:22 EDT 2006


This is done in 2.7.4 on windowsxp.

When you copy paste from the script editor into any html compliant editor,
you get Paragraph marks instead of line breaks.

To fix this I made this little script which I run after any copy command.

But I ran into confusion when it didn't work...

so I copy "styled" text using the "copy" command and call this handler to
fix the html but it doesn't work the way you would expect.

on FixClipboardHTML
  local c
  get the clipboard -- only contains TEXT!
  put the clipboarddata["HTML"] into c 
  -- c is not empty contrary to what the clipboard function may say!
  get the clipboarddata["HTMLText"] -- empty contrary to documentation and
c's content
  if c is not empty and "</p>" is in c then
    replace "</p>" with "" in c
    replace "<p>" with "<BR>" in c
    set the clipboarddata["HTML"] to c -- seems to work and the result is
empty!
    get the clipboarddata["HTMLtext"] -- still empty!
    get the clipboarddata["HTML"] -- but wait, there's absoluty no sign of
replacements done!!!
  end if
end FixClipboardHTML

Any work-arounds welcome...

cheers
Xavier




More information about the use-livecode mailing list