How to select a cell instead of a line in a table
J. Landman Gay
jacque at hyperactivesw.com
Mon Jun 16 22:37:36 EDT 2008
Kresten Bjerg wrote:
> Hi
> Been working several hours with the copy paste solution, but all attempts to copy selectedchunk (or chunkinfo) to a selected field
> (in order to retrieve the selectedtext (with fontspecifications) from there, to a variable, for further processing) fails.
> The variable watcher reports e.g. on Put the clickchunk into chunkInfo : "char 108 to 117 of field 363". But all attempts to copy the thus indicated
> chunk gives an elaborate "it" (many level adresses) different from the text in the cell. And nothing gets pasted to the (visibly) selected field. It seems like the
> whole table is copied instead.
> Could you suggest the scriptlines, which could do the trick ?
You can set the clipboard contents directly without actually copying or
pasting, retrieving either plain text or styled text:
set the clipboardData to the selection -- plain text, the default
set the clipboarddata["html"] to the htmltext of the selection -- styled
text
If all you need is the text and font specs, you can do it directly in a
couple of lines:
put the selection into myVar -- contains plain text
put the effective textfont of the selection into myFont
You can also get any other text properties. Usually there's no need to
actually copy and paste, but I haven't been following this thread so I
may have missed something.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list