Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


Privacy Policy

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.


 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

CSStoFMText (text)

Rate this function:  

  Average rating: 4.3  (41 votes)
  Discuss this Custom Function

Christopher Gauntt, Cordega Solutions

Converts CSS inline styles to FileMaker Pro Text

Sample Input:
<SPAN STYLE= "text-transform: uppercase;" >Let's see how it converts back.</SPAN>
Sample Output:

 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed


This takes CSS styled text and converts it back to FileMaker Pro formatting.
The Hex to RGB converter calc was supplied by Klemens Müller,, 05.07.2006

Note: I don't have the fontScript variable figured out yet. I couldn't find anything in CSS documentation that seemed equivalent. But the variable is there in case someone else figures it out.

UPDATE: April 6, 2009
Added If statement to wrap around function in case text doesn't have any SPAN tags.

Note, if you not converting a field directly, don't forget to put the \ before the quote if you are embedding the tags into a calculation.

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

This is my Custom Function and I want to edit it


5 most recent comments | Show all 6 comments

I finally got around to fixing it. Sorry for the ridiculously long delay. I didn't even know there was a problem until one of my colleagues found the function and the comment.

Christopher Gauntt, North Hollywood
May 15, 2010 5:21pm

I convert GetAsCSS(field) back
I needed an additional Substitute(field," ¶","") . (that's substitute space newline with empty)

Thank you for the very helpful function CSSToFMText and Happy New Year 2011.

Peter F., Zurich
December 31, 2010 10:05am

Nice little function. Ive been working on building text editor functions into a FM database am trying to find a slick way to get formatted text into a MS word document. This kind of thing is helpful and may form part of the solution

One small bug:

"Strikethrough" is "Line-through" in CSS land.

Also It doesn't handle chinese characters. A must in this corner of the world.


Mike, Taipei
January 19, 2011 1:19am

I had to add the following for it to successfully render the line breaks.

Key changes are lower case line break and added extra substitute for <br/>

Here is the change and addition. Works just fine now in FM14 and thanks heaps.

// swaps out breaks with FileMaker return markers
; $_Text = Substitute ( $_TextSpan ; "<br>" ; "¶" )
; $_Text = Substitute ( $_TextSpan ; "<br/>" ; "¶" )

Peter van Herk, Brisbane, Australia
July 16, 2015 4:05pm

Regarding your comment, Peter. The Substitute function is case sensitive and there is sometimes a space before the forward slash. So the full list should be:

// swaps out breaks with FileMaker return markers
; $_Text = Substitute ( $_TextSpan ; "<br>" ; "¶" )
; $_Text = Substitute ( $_TextSpan ; "<br/>" ; "¶" )
; $_Text = Substitute ( $_TextSpan ; "<br />" ; "¶" )
; $_Text = Substitute ( $_TextSpan ; "<BR>" ; "¶" )
; $_Text = Substitute ( $_TextSpan ; "<BR/>" ; "¶" )
; $_Text = Substitute ( $_TextSpan ; "<BR />" ; "¶" )

Or, the nested version:

$_Text =
Substitute (
[ "<br>" ; "¶" ];
[ "<br/>" ; "¶" ];
[ "<br />" ; "¶" ];
[ "<BR>" ; "¶" ];
[ "<BR/>" ; "¶" ];
[ "<BR />" ; "¶" ];

Same goes for the Substitute function at the top as well.

Alec, Brooklyn
December 01, 2016 4:01am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 6 + 6 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. PreviousMonthEndDate ( myDate )
  (Wed, Mar 07, 3:35am)
2. PreviousMonthName (myDate)
  (Wed, Mar 07, 3:33am)
3. FmTableFields ( tableName ; fieldsInclude ; fieldsExclude ; classExclude ; typeExclude ; prefixExclude )
  (Fri, Mar 02, 6:32am)
4. sql.getTable ( fullyQualifiedFieldObject )
  (Thu, Feb 22, 8:36am)
5. sql.getField ( fullyQualifiedFieldObject )
  (Thu, Feb 22, 8:34am)
6. FilterOut ( ListA ; ListB )
  (Wed, Feb 21, 6:11pm)
7. Char0 ( )
  (Sun, Feb 18, 2:35am)
8. CreateVCardFile ( FirstName ; LastName ; CompanyName ; Phone ; Email ; WEB ; hAddress1 ; hAddress2 ; hZip ; hCity ; hCountry ; wAddress1 ; wAddress2 ; wZip ; wCity%2
  (Sun, Feb 18, 1:50am)

RSS Feed of Custom Functions