Jump to content
Server Maintenance This Week. ×

Determining if a Field Contains any Formatted Text


giosbob

This topic is 3832 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello,

 

I need to know if a field contains any formatted text (italics, bold, underline, etc.) regardless of its position or content. By searching discussions on this website and others, I have discovered ways to format and unformat selected text and whole fields using various functions, but I have not found a function or script step that will return a "yes" or "no" to the question: does this field contain any formatted text, that is, does it use fonts that are not "regular."

 

Any ideas or suggestions on how to do this?

 

(My experience level is between novice and intermediate, so I apologize if the answer is obvious to more experienced FileMaker users.)

 

Thanks,

 

-Robert.

Link to comment
Share on other sites

You can see the field's formats by looking at the result of GetAsCSS( ) or GetAsSVG( ) function. For example,

PatternCount ( GetAsSVG ( "plain text" & YourField ) ; "<Style#1>" )

will return True (1) if the text in the field has any formatting (font, style, color, etc.) applied to it - in part or in whole - False (0) otherwise. I don't think it can sense text alignment, though.

Link to comment
Share on other sites

if you had Advanced I would say a simple custom function and use getasCSS(text)  and pattercount  to check for "bold","italic", etc..  but you can do it with a script or a calculation field as well

let me know if you need more help

Link to comment
Share on other sites

This topic is 3832 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.