7 Replies Latest reply on Apr 26, 2016 9:05 AM by rgordon

    Copy and Paste


      Good Morning!


      Is there a way to add a calculation to a text field so that any formatting (font, color, size, etc.) from an external source is automatically "ignored" and the field's formatting is used instead?


      I came across this, which works, but I don't want the user to have to remember to do this special key combination upon entry:  Pasting from the clipboard normally pastes the text style of the source text; to paste unformatted text, use option-paste (on the Mac OS, use the key combination Command-Option-Shift v



        • 1. Re: Copy and Paste

          TextFormatRemove ( Self ) comes to mind …


          btw, after pasting formatted text, hitting Cmd/ctrl-Z is sufficient to get rid of just the formatting; you'd need to press that combo again to undo the paste operation itself.

          • 2. Re: Copy and Paste

            In your field options, select an auto-enter calculated value with the following calculation:


            TextFormatRemove ( Self )


            Be sure that "Do not replace existing value of field (if any)" is unchecked.


            You may also look into combining this with something like Debi Fuchs' Supertrim function to remove additional characters that may get inadvertently entered.


            For example, I use the following calculation on several fields such as firm name or project name where people may be copying and pasting information...


            Supertrim ( TextFormatRemove ( Proper ( Self ) ) )

            • 3. Re: Copy and Paste

              That helps!  I thought that "self" referred to the applicable field, and not the actual word "self".  So that is helpful.  THANKS!

              • 4. Re: Copy and Paste

                The suggested calc will work but be aware that it will also prevent the user from making any formatting changes to the text and it will wipe out any previous format changes.

                • 5. Re: Copy and Paste

                  In addition to the good suggestions that have been made...

                  There are 10 FileMaker "Text Formatting" Functions: 4 pairs and 2 others...

                  1. RGB ( red ; green ; blue )

                  You can add and remove color
                  2. TextColor ( text ; RGB ( red ; green ; blue ) )
                  3. TextColorRemove ( text { ; RGB ( red ; green ; blue ) } )

                  You can add or remove
                  font faces
                  4. TextFont ( text ; fontName { ; fontScript } )
                  5. TextFontRemove ( text { ; fontToRemove ; fontScript } )

                  You can add or remove the
                  font size
                  6. TextSize ( text ; fontSize )
                  7. TextSizeRemove ( text { ; sizeToRemove } )
                  You can add or remove font styles: Bold, Italics, Underline and more...
                  8. TextStyleAdd ( text ; Bold )
                  9. TextSizeRemove ( text {; sizeToRemove } )

                  You can remove Text Formatting selectively using functions listed above, or all at once:
                  10. TextFormatRemove ( text )

                  Hope that helps.

                  Tony White

                  • 6. Re: Copy and Paste

                    Contrary to rgordon's suggestion, the AE calc change will not by itself change any existing formatting. However, as soon as you edit that field in an existing record, the formatting will change.

                    • 7. Re: Copy and Paste

                      Bruce, I agree with what you are saying and that was the intent of my comments. I should have added "if you edit the field" to the end of the comment. I wanted to warn the OP that there might be some unwanted consequences if they use the AE.