As long as the field does not have a scroll bar and this is FileMaker Pro and not FileMaker Go,
You can use the Get ( ActiveSelectionStart ) to get the location of the cursor as produced by your mouse click. You can then use that to determine which value was clicked in the field.
This is demonstrated as a "list box pick list" on the "portals and other pick lists" section of "Adventures in FileMaking #2 - enhanced value selection"
That's very cool!
I used a middle function with Get(ActiveSelectionStart) and Get(ActiveSelectionSize) to get the highlighted text in a multi-line text field.
At the end of both adventure files, I used a variation of this method to create hyperlink text on the additional resources layout. Clicking the blue underlined text opens the web page to specified site in the user's default web browser.
That's very cool.
I also enhanced the basic method I described above (assuming Paragraph markers in all but the last row) to be able to return the text if you just click in on the line but don't necessarily highlight it.
You would then still see the entire line.
Here's the basic idea (just a more intelligent Middle function from my first attempt):
Middle (TestFile::text; Position ( TestFile::text ; ¶ ; Get(ActiveSelectionStart) ; -1 );
Trim(Length(Get (ActiveFieldContents)) - Position ( Trim(TestFile::text) ; ¶ ; Get(ActiveSelectionStart) ; 1 ) ) )
Thanks again Phil!
The List Box examples in Adventure #2 produce the same result though their scripts use different functions to produce the same result, but without need to click the button, the mouse click into the field performs the script for you.
Sounds excellent. I hadn't thought of that enhancement to my latest demo code yet... ;)