copy from a locked, focusable fld under Windows
André.Bisseret
Andre.Bisseret at inria.fr
Mon Mar 13 05:53:10 EST 2006
Thanks a lot to Jonathan, Wilhelm, Jim and Chipp for their very useful
ideas and solutions.
I confirm that here (G4, OSX, 10.2.8 -RR 2.6.1) neither "command c" nor
"command C" is working (; but as Wilhelm said "Copy text" from Edit
menu works.
Meanwhile, "command v" as well as "command V" works.
The following handler works on Mac, keeping the html form :
on copySelection
if the selection is empty then -- there is no selection then
answer "No selected text"
exit copySelection
else
copy the selectedText
answer "The selected text is in the clipboard"
end if
end copier
In order to try on Windows, I made another button, and I intercepted
"command c" using the handler of Jonathan (below).
Nevertheless, I needed to replace the line "if the selectedfield <>
empty then" by "if the selection is empty then" (or "if the
selectedText is empty" as well).
The reason is that a single click in the field (without any text
selected) is setting "the selectedfield <> empty" to true (so that it
is reporting "The selected text is in the clipboard" and then copying
nothing).
I have not had the opportunity to test that on Windows yet.
I will inform you about the results as soon as I would have done it :-)
Best regards from Grenoble
André
Le Saturday, 11 Mar 2006, à 00:16 Europe/Paris, Jonathan Lynch a écrit :
> This is how I would up doing it:
>
> on RawKeyDown pKey
> if (pKey = 99 or pKey = 67) and the commandkey is down then
> if the selectedfield <> empty then
> put the selection into tSel
> put the htmltext of the selection into tSelHtml
> set the clipboarddata["text"] to tSel
> set the clipboarddata["html"] to tSelHtml
> select the selectedchunk
> exit rawkeydown
> end if
> end if
> pass rawkeydown
> end rawkeydown
>
> This is adapted from a the rawkeydown handler in taskmage, which does a
> bunch of other stuff that does not need to be included here.
>
> I find this script works well, and allows you to copy both formatted
> and
> unformatted text so that it can be copied from a rev application and
> pasted
> into any other application.
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
>
More information about the use-livecode
mailing list