12 Replies Latest reply on Aug 7, 2012 8:49 AM by AlanStirling

    TextFormatRemove - any way to override?

    NancyAdelman

      A client wants the best of both worlds - don't we all?

       

      He wants to paste text into a field and have the local formating removed. No problem, with an auto-enter option and the TextFormatRemove function.

       

      But after he pastes in the initial text, he then wants to be able to format parts of the text and have it stick. For example, he might want to make one sentence bold, or underline a word or two. Of course, the auto enter option removes this, too.

       

      Any ideas on how to allow him to do it all - paste in intital text, remove the formatting and then format the text the way he wants?

       

      Thank you.

       

      Nancy

       

      Nancy Adelman

      Adelman Databases

      PO Box 11741

      Alexandria, VA 22312

      703-597-3521

      www.adelmandatabases.com

      FileMaker 8, 9, 10, 11 Certified Developer

      Member, FileMaker Business Alliance

        • 1. Re: TextFormatRemove - any way to override?
          beverly

          Hey, Nancy! Teach him how to UNDO immediately after the paste? It removes the formatting. Two UNDO's means 'remove-what-I-pasted', so just the one is needed.

           

           

          Beverly

          • 2. Re: TextFormatRemove - any way to override?
            TomHays

            Like Beverly suggested, disable the automatic removal of all formatting.

             

            Then teach your client how to hold down the Shift key when pasting in on Microsoft Windows. On the Mac hold down the Option key. The added key will change the normal paste into Paste Without Formatting.

             

            Use Beverly's Undo suggestion for cases when the user forgets to hold down the modifier key.

             

            -Tom

            • 3. Re: TextFormatRemove - any way to override?
              NancyAdelman

              Thank you both for the suggestions.

               

              Nancy

              • 4. Re: TextFormatRemove - any way to override?
                comment

                NancyAdelman wrote:

                 

                But after he pastes in the initial text, he then wants to be able to format parts of the text and have it stick.

                 

                Use a modifier key to distinguish between the two: either during pasting (as suggested by Tom) or during editing.

                • 5. Re: TextFormatRemove - any way to override?
                  gobbles

                  I would appreciate a different solution to the exact identical issue.

                   

                  I realse the issue ultimately is the end user, however, I can't be there to hold the hand of everyone who will be pasting stuff into my DB and so need a way to automate this.

                   

                  logically it should got

                   

                  either:

                  TextFormatRemove() o first paste only then stop

                   

                  or

                   

                  is there some way to restrict only the font and size while leaving other formatting alone (eg: bold, underline)? If there was a function that autocorrected only font and font-size I would be super happy!

                  • 6. Re: TextFormatRemove - any way to override?
                    comment

                    gobbles wrote:

                     

                    If there was a function that autocorrected only font and font-size I would be super happy!

                    Rejoice:

                    http://www.filemaker.com/11help/html/func_ref3.33.95.html#1032398

                    http://www.filemaker.com/11help/html/func_ref3.33.98.html#1032544

                     

                     

                     

                    gobbles wrote:

                     

                    logically it should got

                     

                    either:

                    TextFormatRemove() o first paste only then stop

                    I didn't get this part.

                    • 7. Re: TextFormatRemove - any way to override?
                      gobbles

                      Michael Horak wrote:

                      gobbles wrote:

                       

                      logically it should got

                       

                      either:

                      TextFormatRemove() o first paste only then stop

                      I didn't get this part.

                       

                       

                      A bit vague sorry, I just meant that it would be ideal if it could apply the format removal once only (when things are typed or pasted into the field for the first time) and then allow users to change it thereafter.

                       

                      In the end I went with something like this:

                       

                      TextSize( TextFont(  TextColorRemove(field); "Helvetica" ) ; 12)

                       

                      That way at least users can underline/bold etc.

                       

                      Your post was most helpful though!

                      • 8. Re: TextFormatRemove - any way to override?
                        comment

                        gobbles wrote:


                        In the end I went with something like this:

                         

                        TextSize( TextFont(  TextColorRemove(field); "Helvetica" ) ; 12)

                         

                         

                        I believe you are making a mistake by tagging the text with specific font and size attributes. This should be set at the layout level, not at the data level. The way you have it now, the text will continue to show in Helvetica 12 even if you modify the layout by applying a different font/size to the field's instance,

                         

                         

                        gobbles wrote:


                        it would be ideal if it could apply the format removal once only (when things are typed or pasted into the field for the first time) and then allow users to change it thereafter.

                         

                        It is sort of possible, by using the Get (RecordOpenState) function to determine whether to remove the formatting or not. However, Filemaker won't be able to distinguish between user formatting the text deliberately and user pasting formatted text over existing one.

                        • 9. Re: TextFormatRemove - any way to override?
                          gobbles

                          Michael Horak wrote:

                           

                          gobbles wrote:


                          In the end I went with something like this:

                           

                          TextSize( TextFont(  TextColorRemove(field); "Helvetica" ) ; 12)

                           

                           

                          I believe you are making a mistake by tagging the text with specific font and size attributes. This should be set at the layout level, not at the data level. The way you have it now, the text will continue to show in Helvetica 12 even if you modify the layout by applying a different font/size to the field's instance,

                           

                           

                          The problem is, there will be multiple users "cutting and pasting" from all kinds of places; email, word docs, text files. I will not be able to control how they do it. Once in the database font anf fontsize and colour at very least need to be consistant.

                           

                          Some of the fields are getting printed out on single documents. I suppose I could force the formatting when things are printed out, however, for consistency I have been asked to find a way to standardise the font etc while still allowing some flexibility for underlining, bolding etc.

                           

                          if there is a better way to do this I would love to know.

                           

                          I realise it is going to be a pain should font and fontsize ever need to be changed.

                           

                          I had even considered trying to use something like the above functions with variables that users could set somewhere else, to allow for style changes down the track. Not 100% sure if FB allows this.

                          • 10. Re: TextFormatRemove - any way to override?
                            comment

                            gobbles wrote:


                            I have been asked to find a way to standardise the font etc while still allowing some flexibility for underlining, bolding etc.

                             

                            This is precisely why specific TextXRemove() functions exist. Instead of "standardizing the font", you should standardize the text to having no font attribute at all. This is the only way you will be able to use different fonts for screen display and for printing, for example.

                            • 11. Re: TextFormatRemove - any way to override?
                              gobbles

                              I take your point. ty for your patience.

                              • 12. Re: TextFormatRemove - any way to override?
                                AlanStirling

                                Hi there

                                 

                                I can think of another option for your issue.

                                 

                                Have you tried pasting text whilst holding down the 'Alt' key?

                                 

                                This allows text to be pasted into a field without formatting. This would allow specific formatting later, but would mean that all text that was pasted in would take on the settings for the field.

                                 

                                This would probably have to be controlled in some way - for example a button on the layout, called 'Paste', atteched to a script which used this facility. You might have to modify the menus on this layout to stop anyone typing 'Cmd-V'. But I think this would give you what you're searching for.

                                 

                                Best wishes - Alan Stirling, London UK

                                (Currently sitting in Wembley Stadium, waiting for the Mexico v Japan football match to start!)

                                 

                                 

                                Alan Stirling Technology Ltd, 135 Lisson Grove, London NW1 6UP

                                +44 (0) 20 7724 2456 - alan@ast.fm - www.ast.fm.

                                FileMaker Certified Developer for versions 7, 8, 9, 10, 11 and 12.