I am trying to get a double click in a text field to
1. copy the hilited text to the clipboard so it can be pasted into a different text field
2. set the textStyle of the hilited text to Link
I have tried
on mouseDoubleUp
get the selectedChunk of me
set textStyle of the selectedChunk to "Link"
end mouseDoubleUp
but no luck. Any suggestions?
Also ...
What script would I put in the receiving field so that when the mouse is clicked in it the text copied from the first field is inserted at that point?
mouseDoubleUp
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 73
- Joined: Sat Apr 08, 2006 6:51 pm
mouseDoubleUp
In nova fert animus mutatas dicere formas corpora.
Re: mouseDoubleUp
Hi Preston,
unfortunately editable fields do not receive mouseevents (mousedown/-up/-doubledown/-doubleup), except when the ALT key is pressed.
"the selectedchunk" also returns a description of the field, so "the selectedchunk OF ME" does nothing,
although I would have exspected an error.
Maybe you could trap the "selectionchanged" message?
## What script would I put in the receiving field so that when the mouse is clicked in it
## the text copied from the first field is inserted at that point?
Hm, I would store the text of the other field in a (global) variable or custom property first and then use "on openfield"
since "opening" that field would remove the selection from the first field!
Best
Klaus
unfortunately editable fields do not receive mouseevents (mousedown/-up/-doubledown/-doubleup), except when the ALT key is pressed.
"the selectedchunk" also returns a description of the field, so "the selectedchunk OF ME" does nothing,
although I would have exspected an error.
Maybe you could trap the "selectionchanged" message?
## What script would I put in the receiving field so that when the mouse is clicked in it
## the text copied from the first field is inserted at that point?
Hm, I would store the text of the other field in a (global) variable or custom property first and then use "on openfield"
since "opening" that field would remove the selection from the first field!
Best
Klaus
Re: mouseDoubleUp
The mouseDoubleDown message is sent to the card when you click into unlocked fields. You can trap this.
In the card script:
on mouseDoubleDown
put the selectedText && the selectedField
end mouseDoubleDown
In the card script:
on mouseDoubleDown
put the selectedText && the selectedField
end mouseDoubleDown