Here's an approach that handles text where all sentences end with a
period (.) - admittedly not very real-world, but maybe it will stir some
thoughts. This handler converts the user's click on a word to a sentence
number:
on mouseUp
set the itemDelimiter to "."
put the clickChunk into tTextChunk
put 1 into word 2 of tTextChunk
put the number of items in (value(tTextChunk))
end mouseUp
HTH. Phil
Nicolas R Cueto wrote:
>
> Hello.
>
> When a user clicks on a word in a sentence (not a cr-line but a
> grammatical sentence), how could I find out the number of that sentence?
> I'd like to create sound files for each of the sentences in a paragraph,
> and then label each sound file with a corresponding number. For example,
> I'd want sound file "2.au" to be played when the user clicks anywhere
> within the second sentence of this paragraph:
>
> This is the first sentence. "However this," she said,
> "is the second sentence." Is this, then, the third sentence?
>
> I've consulted clickChunk, clickChar, etc., and thought about playing
> with the itemDelimiter (there's no such thing as a lineDelimiter, is
> there?) but can't figure out anything, elegant or ugly.
>
> Thank you in advance.
>
> --
> Nicolas R Cueto
> Takakura JHS/SHS
> Nagoya, Japan
>
> This is the MetaCard mailing list.
> Archives: http://www.mail-archive.com/metacard%40lists.best.com/
> Info: http://www.xworlds.com/metacard/mailinglist.htm
--
Phil Davis
------------------
[EMAIL PROTECTED]
This is the MetaCard mailing list.
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm