Clipboard
J. Landman Gay
jacque at hyperactivesw.com
Sat Jun 23 01:46:24 EDT 2007
-= JB =- wrote:
> How do you set the clipboard to empty.
You did it fine. "set the clipboardData to empty".
> Don't ask why because
> I really have no reason except I am curious if it can be done.
Ours is not to question why. :)
> If
> I use the script below it will empty the clipboard from viewable
> contents but it will not set the clipboard to empty. So when I
> use the clipboard function it will not return empty even though
> I can't see anything after putting nothing on the clipboard.
>
> set the clipboardData to ""
> put the clipboard into clipInfo
> ask "Clipboard" with clipInfo
They're different things (and they work differently than in HC.) The
"clipboardData" is the actual contents. You can set or get it. It's
actually an array, and you can request a specific type of data from the
array. If you don't specify a type, the default is text (there are
exceptions.) This is pretty much the equivalent of HyperCard's "the
clipboard", except HC only worked with text exclusively.
The other function, the clipboard, is SuperCard's terminology. It gives
you the type of data in the clipboard. The clipboard can be "text" or
"image" or "controls" or other types.
You can use "the clipboard" to find out what type of content is in it,
and then get "the clipboardData" to actually grab the contents. For
example, after you copy an image from somewhere:
the clipboard --> "image"
the clipboardData["image"] --> binary stuff
If there is only one type of content, you don't need the array notation;
whatever is in there will be accessed (that's the exception to the text
default I mentioned.) But sometimes the clipboard has several types of
data in it at the same time (like, text and HTML) and then you can use
the array notation to extract only the type you want.
When you set the clipboardData to empty, the contents are empty but it
still has a type. The clipboard is "text" when I try that; apparently
Rev thinks empty is a text type.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list