Brian Dunning's FileMaker Custom Functions

CF_HTMLtoFMP_styledText ( text ; num )

Converts data between predefined HTML tags into FMP bold / italic etc. As well as standard HTML tags, you can also define your own custom tags.

  Average rating: 3.9 (52 votes) Log in to vote

Chaim Bacon   Chaim Bacon - Show more from this author
SeekUnique
http://www.seekunique.co.uk

Share on Facebook Share on Twitter

  Sample input:
Bold text
Italic text
put this in caps

This text will show in 24pt

  Sample output:
Bold text
Italic text
PUT THIS IN CAPS
This text will show in 24pt

(It is unlikely the sample output text will display formatted on this website. However it does in FMP)

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

See description in custom function above.

NOTE: The other custom function 'CF_HTMLtoFMP_styledText_sub' is required for this one to work.

You can download a fully working sample file of this function at:
https://www.dropbox.com/s/slkfotd4wtlyxpq/HTML_to_FM_Styled_Text.fmp12?dl=0

 

Comments

Daniel H.   Daniel H., Pasadena, CA
Sep 20, 2015
Does not seem to work, just returns a ? for me when used in 14.
 
Chaim   Chaim, Bacon
Sep 21, 2015
Hi Daniel, did you also install the other custom function. There is a note on the page, just above your comment, that says, "NOTE: The other custom function 'CF_HTMLtoFMP_styledText_sub' is required for this one to work." I have tested it in FMP 14 - with the subordinate function - and it works fine. Please download the sample file (there is a link above).
 
Kyle Williams   Kyle Williams, Augusto Digital
Dec 23, 2020
FYI: Your sample file link no longer works...
 
Mark D Kerr   Mark D Kerr, Discovery Reef Design & Consulting
Jul 28, 2021
I'd be thrilled to see the demo, but the old link is no longer valid.
 
Chaim Bacon   Chaim Bacon, SeekUnique
Jul 28, 2021
Hi Mark, I have made a new sample file and it works as expected way back when it was written in 2008. Tested on Mac with FM 19 but can't see why it wouldn't work on Win or any recent version of FM. Please use this link to download: https://www.dropbox.com/s/slkfotd4wtlyxpq/HTML_to_FM_Styled_Text.fmp12?dl=0
 
Dan Shockley   Dan Shockley
Sep 20, 2024
Interesting function!
Have you considered using longer variables names for $text and $quote?
If someone uses this custom function and a running script using the same variables internally happens to call the CF, or perhaps even visits a layout on which there is a field or other layout object that calls it, the script's own values in those variables will be trampled.
Some kind of pseudo-namespace might be wise: perhaps $varText_CF_HTMLtoFMP_styledText and $varQuote_CF_HTMLtoFMP_styledText ?
(Same comment regarding the sub-function.)
 
Chaim Bacon   Chaim Bacon, SeekUnique
Sep 22, 2024
Hi Dan and anyone else looking at this CF. I developed this function way back in 2014 and am happy it works well for most people. However, my business has grown and now moved away from FileMaker, primarily due to the slow pace of FM development and falling further and further behind. We are now focussed on our vertical market SaaS software for art & antiques dealers, written in proper 21st Century technologies which offer features FileMaker can't even dream of, let alone actually build. Sorry to say, but I will not be developing these CFs any further. If someone else wants to update and test them, I would be delighted to submit the updated code here.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 21 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: