Sign in to follow this  
Followers 0

How to highlight URLs in text?

7 posts in this topic

Posted

Can anyone offer a suggestion for a good approach to highlight URLs within text fields? FMP has provided the right-click "Open: http: //........" for years. However, it's often hard to spot a short URL (like http:// www .m-w.com) in a large text block. I'd like to have any URL highlighted in a different text color or maybe underlined like a link.

I've considered occasionally running a script to parse all text fields in my application and insert color settings. Or (in FMP 10) have a script that executes upon exiting each field, to modify them one at a time. Hopefully, someone has considered this before and can offer some insight.

Thanks for any help.

Share this post


Link to post
Share on other sites

Posted

Is the text field a concatenation of several fields? i.e. Name, address, web site, notes, etc., or is this a large text field where the information is already part of the text in the field?

Lee

Share this post


Link to post
Share on other sites

Posted

an option would also be to use a web viewer to display the text block then the url's would appear as links making them clickable...

http://www.filemakermagazine.com/videos/zero-to-awesome-using-data-objects.html

http://sixfriedrice.com/wp/filemaker-9-tip9-web-viewers-without-the-web/

Share this post


Link to post
Share on other sites

Posted

Lee --

It's a large text field. And I forgot to mention that it might contain more than one URL.

Ocean --

An interesting idea. Unfortunately, the layouts involved are somewhat set in stone so web viewer can't be used in my specific instance.

Share this post


Link to post
Share on other sites

Posted

It should be quite easy to "highlight" the http:/ prefix, by substituting it with a styled version of the same. To do this for the entire URL would require a custom recursive function (or a script) - which could get rather complex, esp. since a URL can be followed by a variety of punctuation characters.

Share this post


Link to post
Share on other sites

Posted

Thanks for the suggestion.

I'll probably just go for the highlight of the prefix. Oddly, though, FileMaker has an internal calculation that can exactly isolate a URL within text. It never seems to miss displaying the "Open://www......." upon a right click within the field. Too bad it can't be accessed.

Share this post


Link to post
Share on other sites

Posted

I suspect this is a service provided by the OS and not something that Filemaker does on its own. At least on a Mac, you get the same option in just about any application that allows you to edit text. In any case, Filemaker programmers have access to regular expressions - unlike Filemaker developers.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0