Monday, September 12, 2011

FileMaker TIP: Get Selected Text

The other day I came across the need to grab the currently selected text that the user had selected. I (mistakenly) thought there was already a built-in function to do that... ummm... nope.

So, I came up with a quick calculation to do it:
Middle ( Get ( ActiveFieldContents ) ; Get (ActiveSelectionStart) ; Get ( ActiveSelectionSize ) )
You can package it up as a function, or use it (like I did) in a script to set a variable to whatever text the user has selected. I hope this helps!

2 comments:

Unknown said...

Thanks, Bob! That is a definite timesaver for me. I couldn't figure out how to use substitute just on the selected portion of text. Your formula did it.

Reb

Unknown said...

Thanks, Bob. That was a real help. I couldn't figure out how to use substitute just on selected text .

Web Analytics