Clipboard Data

Bill Marriott wjm at wjm.org
Tue Jun 20 00:44:44 EDT 2006


Multiple methods to accomplish this.

First, why do you need it as "text?" Most networks handle binary data just 
fine.

Assuming it does have to be plain-text here are some methods:

[Method 1]

Put the cards (holding the objects you want)  into a new stack. Example:

copy this card to stack "mystack"

moves a whole card and its objects at once, and doesn't affect the 
clipboard.

Compress the stack and then convert it into Base64. For example:

put base64encode(compress(URL "file:mystack.rev")) \
  into URL "file:mystack.txt"

will create a plain-text version of such a stack.

put decompress(base64decode(URL "file:mystack.txt")) \
  into URL "file:mystack.rev"

will unpack it. Either omit objects you're not interested in before sending, 
or delete them after receiving.

[Method 2]

Walk through the properties of the object and store them as an XML tree or 
an array. Send the array over and then recreate the objects. [a much more 
complicated script]


"Bridger Maxwell" <bridgeyman at gmail.com> wrote 
in message 
news:86ae76bb0606192056q1fcf15e9u55b305f3b5ecd5e7 at mail.gmail.com...
> Hey,
>  I was wondering if there was any way to represent objects (or an entire
> card) as text so it can be sent over a network and be unpacked somewhere
> else.  I messed around with the clipboard and made a stack that copies the
> objects to a new stack, saves the stack, sends the stackData to the other
> computer, and copies the objects to the other stack.  This works, but it 
> is
> overly complicated and a little too unstable.  The clipboard() function
> returns "objects" when I have copied buttons or cards, but the
> clipboardData["objects"] doesn't return anything.  Does anyone know why?






More information about the use-livecode mailing list