On Apr 3, 2007, at 1:46 PM, Curt Ford wrote:
In my project I want to let users enter text into a field, then
highlight some text to add a link; the field contents are then
saved to a text file to be read in later & displayed with an active
link.
This works fine, attached to a button for adding a link:
on mouseUp
set the textStyle of the selectedText to "link"
set the linkText of the selectedText to "http://www.google.com"
put the HTMLText of fld "source" into fld "resultHTML" --a check
to see how it looks
end mouseUp
But when I try to let the user enter a link with:
on mouseUp
ask "Please enter a link:"
put it into tLink
set the textStyle of the selectedText to "link"
set the linkText of the selectedText to tLink
put the HTMLText of fld "source" into fld "resultHTML"
end mouseUp
..the link ends up following the text that was selected; so if in
"one two three" the "two" was highlighted, the result is:
<p><font face="Geneva">one two<a href="www.google.com"></a> three</
font></p>
Is there a way I can keep the ask dialog box from interfering with
the selection?
Curt,
The ask dialog will change the selection, so the best approach may be
to save the selectedChunk information in a variable while you do the
ask dialog, then restore it after the dialog is dismissed.
put the selectedChunk into tSelChunk
ask "Please enter a link:"
put it into tLink
select tSelChunk -- or whatever the precise syntax would be
-- do the rest of your business here.
HTH
Devin
Devin Asay
Humanities Technology and Research Support Center
Brigham Young University
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution