Saving the clipboard

Dan Friedman dan at clearvisiontech.com
Tue Dec 10 15:18:01 EST 2002


Hello!

My standalone contains several stacks files.  During the course of activity
in my standalone, I copy objects from one stack to another.  I want to
preserve the clipboard text during the copy/paste of objects.  Here are the
calls I am using to save the clipboard text:

on aLongRoutine
  --a whole bunch of stuff
  --focus is now on a stack file that is not in the standalone
  
  put saveClipboard() into isCBSaved
  
  --copy some objects
  --focus on another stack
  --paste objects

  if isCBSaved then
    restoreClipboard
  end if
end aLongRoutine

function saveClipboard
  if the clipboard is "text" then
    select text of field "tempClipboard" of stack "aStack"
    --stack "aStack" is the mainStack of the standalone
    paste
    return true
  else
    return false
  end if
end saveClipboard

on restoreClipboard
  select text of field "tempClipboard" of stack "aStack"
  copy
end restoreClipboard


The problem is the focus.  The text is not being pasted or copied from field
"tempClipboard" of stack "aStack".  Anyone have any ideas of what I am doing
wrong?

Thank you in advance,
Dan




More information about the use-livecode mailing list