selectedText from a palette?

Rich Lague laguer at ucs.orst.edu
Wed Sep 8 19:28:01 EDT 2004


I’m still  having problems with using the “selectedText” from a palette.

I trying to make an application that has most of it’s functionality on 
a palette-- a bunch of different buttons that will do different stuff 
to the main data stack. Most things work, but handlers that involve the 
“selectedText” don’t seem to make it to the main stack, (which is the 
topStack.)
One thing I would like it to do is allow the user to highlight some 
text in one of the fields on the current card and then click a button 
on the palette and have the text put into a field. It will also set the 
name of the card to that “selectedText”.

My other buttons on the palette work, for example:

on mouseUp
   set the defaultStack to the topStack
   delete this card
end mouseUp


However, this does not work:

on mouseUp
set the defaultStack to the topStack
put the selectedText into field "card-name"
   set the name of this card to the selectedText
end mouseUp

So, I tried doing my data-moving in the script of the main stack. This 
script works when called from a button on the current card of the main 
stack:

on testO
   put the selectedText into field "card-name"
   set the name of this card to the selectedText
end testO


But it does not work to call the above script from a button on the 
palette. I tried:

on mouseUp
set the defaultStack to the topStack
testO
end mouseUp


I also tried:

on mouseUp
send “testO” to stack “compareLists”
end mouseUp

So, is there a way to get the “selectedText” to work from a palette?

Thanks!

Rich Lague


More information about the use-livecode mailing list