Transcription

Hi there! This is David at AppWorks again, and I’m here with another FileMaker Cool Trick, so this trick involves getting rid of really ugly formatting for text that people may have customized because of one reason or another – either they wanted to make some fancy fonts, or fancy colors in a field that really doesn’t belong, or maybe they’ve copied some text from a word document that had formatting and then have pasted it into a field and it really kind of screws things up. I’ll show you an example. 

Normally this is just formatted to be white text of a certain size. I can go “this is a great company,” except that I need to spell it correctly. So there, that’s normal. Say I’ve pasted it in from somewhere else, and we’ve got, oh, lovely, comic sans, pink, so this is, you know, really what you want to show on your invoice. Oh, we’ve got company 1 Hour Photo, and this is the description accompanying and it’s really screwing things up. What we really want to have happen is none of this. So let’s get rid of this, and I’ll show you how to automatically clean up that stuff. As soon as somebody pasted in, word tries to type in any formatting whatsoever. It can be a little bit mean if you want to disallow them from using any formatting at all, but sometimes you have to make it simple. So, this is what we do. 

Go into your description field, in the manage database or whatever field you want to do, and you go Calculated value. In this case, hit Specify… and we’re going to go format TextFormatRemove. That’s the function we’re going to use. It removes all text formatting from specified text in a single action, and the text, we’re just going to go ( self ), and that refers to the field itself. OK.

So that now will clear out any formatting. However, we do have to do one more thing. This Do not replace existing value of field (if any), you need to un-check. That means it will replace whatever’s in there with the calculated value. In this case, just the same thing, but with all the formatting removed. And that is the whole of this cool trick! So now, if I try and paste in something ugly and I click out of the field, oh! It’s fixed, and somebody gets really confused and they go “wait a minute, I really, really wanted to use Comic Sans Bold, and, let’s see, double spaced, and I want uppercase and I also want it to be this color, and I want it to be this size, 48 point. Oh! It doesn’t stay. Pretty cool trick! That’s the whole of it, so use that as you will. Have fun and hopefully you’ll watch another one. Thanks.