4 Replies Latest reply on Jul 11, 2011 12:18 PM by singerdf

    Copy formatted text



      Copy formatted text


      I have a number of fields set up on different layouts with various formatting for the fields.  I have a script set up to copy the field and then paste into an email or I paste into a text message.  Although the clipboard should retain the formatting it does not.  I have tried the TextStyleAdd function and that does not work.

      Any suggestions would be great.  

      I am using FM Pro 9 with Snow Leopard on the Mac.

        • 1. Re: Copy formatted text

          Text formats are applied on two levels in FileMaker.

          You can apply a format to a field object on a layout while in layout mode. That format only applies when you are accessing that specific layout and the format cannot be copied to the clipboard as this format is not applied directly to the text stored in the field.

          You can select the text in the field and use the formatting toolbar to apply text formats directly to the text entered into the field in the current record. This only applies to the format to the specific text you selected and only for the current record. It should also be possible to use textStyleAdd to apply formatting to the text in this field also. This text format should be something that you can copy to the clipboard for pasting into other applications.

          Note: Many developers use an auto-enter calculation with TextFormatRemove to strip out user selected text formats and the formats pasted along with data originally copied from another source. If you find that you can't select text in the field and apply a text style to the selected text, check to see if this was set up for the field with which you are working.

          • 2. Re: Copy formatted text

            Hi, Phil,

            Thank you for the information.  I only sort of agree after spending hours playing with this.    You can format the field in layout mode and many of the formats do copy.  Of course the one I need to use:  Titlecase does not.  Do you know of anyway to force the titlecase?  the data is entered in another layout in all lower case letters for ease of typing.  I am using the same field in a new layout and need the Titlecase.  I format the field in layout mode and see it.  It just does not copy.

            Font, size color, underline strikethru all do.  But small caps on down do not.

            Any help would be great.  I have tried using the calculation in the Field setup in manage database and that does not work either.


            • 3. Re: Copy formatted text

              I stand corrected! I didn't think any layout level formats could be copied, but it turns out that this does work with current versions of FileMaker. Interesting that TitleCase does not. Perhaps that inconsistency should be reported in Report an Issue.

              Even selecting the text and directly applying TitleCase doesn't work.

              What did work for me was to use this script step to modify the actual data in the field:

              Set Field [YourTable::TextField ; Proper ( YourTable::textField ) ]

              Then I could copy and paste text from the field into an MSWord file and see the pasted text with all words capitalized.

              • 4. Re: Copy formatted text

                Hi, Phil.  Once again your suggestions have saved the day.  I was not familiar with the Proper function.  Rather than a script, I simply replaced the AddTextStyle in my calculation with Proper and it all works perfectly.  Now i have a script to copy the calculation and when I paste it into a text message on my iphone is looks great.  

                Next up would be a plug-in or script that would allow me to text straight from Filemaker Go.