1 2 Previous Next 15 Replies Latest reply on Apr 24, 2014 10:14 AM by brsamuel

    word processor tabs as opposed to field tabs

    trm1945

      In my script, I'd like to say:

      Set Field [MAIN::eMail _Body:

      "Judges:"

      & ¶ &

      MAIN::R1_P_Judge_1_Name & " <tab> " & MAIN::R1_P_Judge_Score_1 & " points."

      & ¶ &

      MAIN::R1_P_Judge_2_Name & " <tab> " & MAIN::R1_P_Judge_Score_2 & " points."

      & ¶ &

      MAIN::R1_P_Judge_3_Name & " <tab> " & MAIN::R1_P_Judge_Score_3 & " points."

      & ¶ & ¶ ]

       

      To get

      Judges:

      Dave Small 6 points

      David Large 7 points

      Dave Inbtween 8 points

       

      not all tabs are tabs. Is there a text tab in FM12a or can I do a workaround?

        • 1. Re: word processor tabs as opposed to field tabs
          keywords

          In place of " <tab> " in your formula, insert "option+tab"—not literally, but if you use the option and tab keys in the calc dialogue you will be inserting a tab character.

          • 2. Re: word processor tabs as opposed to field tabs
            beverly

            Tabs (within field) will "display" when tab-stops are set. You can preset them from the layout mode, selecting the field and setting the tab stop via inspector. You can also select text in a field and IF you have the text ruler showing, set tab-stops with it. This allows you to slide the controls for making the text where you want it.

             

            <https://www.filemaker.com/12help/html/edit_layout.10.44.html>

            I hope this is what you meant.

             

            As long as the character is the tab: option-tab by entry on Mac and cntrl-tab on Win - or char(9) by calc, then the tab stops will work in field.

             

            Beverly

            • 3. Re: word processor tabs as opposed to field tabs
              trm1945

              I think I need to add a "length" argument as well because with char( 9 ) I get:

               

              Judges:

              Cynthia  MacPherson          8 points.

              Gwyneth Kingham          8 points.

              Glen Charge          8 points.

               

              from this script.

               

              "Judges:"

              & ¶ &

              MAIN::R1_P_Judge_1_Name & Char ( 9 ) & MAIN::R1_P_Judge_Score_1 & " points."

              & ¶ &

              MAIN::R1_P_Judge_2_Name & Char ( 9 ) & MAIN::R1_P_Judge_Score_2 & " points."

              & ¶ &

              MAIN::R1_P_Judge_3_Name & Char ( 9 ) & MAIN::R1_P_Judge_Score_3 & " points."

              & ¶ & ¶

               

              The text is transferred to Mac's Mail program and appears in the message's body. Pictures are added here too by a simple drag and drop. So far, it isn't looking good.

              • 4. Re: word processor tabs as opposed to field tabs
                beverly

                That's the default tab-stops. You must set them where you want.

                 

                -- sent from my iPhone4 --

                Beverly Voth

                --

                • 5. Re: word processor tabs as opposed to field tabs
                  trm1945

                  Let ( $t1 = Char ( 9 ) ;

                  Let ( $t2 = Char ( 9 ) & Char ( 9 ) ;

                  Let ( $t3 = Char ( 9 ) & Char ( 9 ) & Char ( 9 ) ;

                  Let ( $t4 = Char ( 9 ) & Char ( 9 ) & Char ( 9 ) & Char ( 9 ) ;

                  Let ( $n1 = MAIN::R1_P_Judge_1_Name  ;

                  Let ( $n2 = MAIN::R1_P_Judge_2_Name ;

                  Let ( $n3 = MAIN::R1_P_Judge_3_Name ;

                  Let ( $s1 = MAIN::R1_P_Judge_Score_1 ;

                  Let ( $s2 = MAIN::R1_P_Judge_Score_2 ;

                  Let ( $s3 = MAIN::R1_P_Judge_Score_3 ;

                   

                   

                   

                   

                  "Judges:"

                   

                   

                  & ¶ &

                   

                   

                  Case (

                   

                   

                  Length ( $n1 ) ≥ 16 ; $n1 & $t1 & $s1 & " Points " ; //  ≥ 16 chars in Name gets one TAB                     // A name is listed and the Tabs keep the score lined up for various Name lengths.

                   

                   

                  Length ( $n1 ) ≥ 12 ; $n1 & $t2 & $s1 & " Points" ;  // ≥  12 chars in Name gets two TABS

                   

                   

                  Length ( $n1 ) ≥ 8 ; $n1 & $t3 & $s1 & " Points" ;    //  ≥ 8 chars 3 TABS

                   

                   

                  Length ( $n1 ) ≥ 4 ; $n1 & $t4 & $s1 & " Points"       // ≥ 6 chars 4 TABS

                   

                   

                  & ¶ &

                   

                   

                  Case (

                   

                   

                  Length ( $n2 ) ≥ 16 ; $n2 & $t1 & $s2 & " Points" ;    // No second Names get listed but a second Name should be listed.

                   

                   

                  Length ( $n2 ) ≥ 12 ; $n2 & $t2 & $s2 & " Points" ;

                   

                   

                  Length ( $n2 ) ≥ 8 ; $n2 & $t3 & $s2 & " Points" ;

                   

                   

                  Length ( $n2 ) ≥ 4 ; $n2 & $t3 & $s2 & " Points"

                   

                   

                  ))))))))))))

                   

                  // There should be an elegant solution to this rather simple problem but it's elusive.

                  • 6. Re: word processor tabs as opposed to field tabs
                    rgordon

                    You are going to have difficulty copying text with tabs from FileMaker to  Mail.  As Bev stated the default tabs in Mail are causing the alignment problem.  The earlier suggestion will only work if you can set the first tab in both FileMaker and Mail. I don't think there is a way to set tabs in Mail.  Incorporating the length function might work or might not work if you are using porportional fonts because the actual length of each character is different.  The length function gives you the number of characters, not the physical length.  If you use a monospaced font like Courier New you can make this work with this calc.

                     

                    "Judges:"

                    & ¶ &

                    left(MAIN::R1_P_Judge_1_Name &"25 blank spaces";25) & Char ( 9 ) & MAIN::R1_P_Judge_Score_1 & " points."

                    & ¶ &

                    left(MAIN::R1_P_Judge_2_Name &"25 blank spaces";25) & Char ( 9 ) & MAIN::R1_P_Judge_Score_2 & " points."

                    & ¶ &

                    left(MAIN::R1_P_Judge_3_Name &"25 blank spaces";25) & Char ( 9 ) & MAIN::R1_P_Judge_Score_3 & " points."

                    & ¶ & ¶

                     

                    The "25 blank spaces" are 25 spacebars.  This is needed to make each of the judges names the exact same length which then make all of the scores align on the same tab.  You can adjust the number of spaces to whatever works best.  With this calc you could also remove the Char (9) since the tab is no longer needed.

                    • 7. Re: word processor tabs as opposed to field tabs
                      trm1945

                      A quote from Gilda Radner: "Never mind."

                       

                      The solution comes in the form or several fields, modified to show the Judges names and scores which the script moves as a group into another field.

                      Thanks to all for your help but it ain't over till it's over and it looks crude to me. I'm looking at using $$data instead of repeating all the above $data for each field.

                      It'll take time.

                      Thanks again.

                      • 8. Re: word processor tabs as opposed to field tabs
                        keywords

                        For what it's worth, I regard it as a bad approach to simply use multiple tabs or spaces to cater for the differences in length of the text required to fit on each tab stop. A far better approach is to set your tabs to accommodate the longest text you are likely to use at each stop, and just use a single tabe to delineate each column. As noted by Beverley, you define your tab positions in the inspector in layout mode for each affected field instance or text object—see screenshots. If you have more than one field/object that requires the same tab stops you can copy and then point the field to the new field, as the formatting will remaain with the field instance.

                        Screen Shot 2014-04-23 at 6.41.02 PM.pngScreen Shot 2014-04-23 at 6.44.50 PM.png

                        Screen Shot 2014-04-23 at 6.44.30 PM.png

                        1 of 1 people found this helpful
                        • 9. Re: word processor tabs as opposed to field tabs
                          rgordon

                          Setting the tabs in FileMaker is not the issue. That is easy to do. The problem is when the text is copied into Mail.  How are you going to set the tabs in Mail?  I believe Mail only has preset tabs. Using a mono spaced font solves this problem since every character is the exact same length.

                          1 of 1 people found this helpful
                          • 10. Re: word processor tabs as opposed to field tabs
                            erolst

                            trm1945 wrote:

                             

                            [ unnecessarily lengthy code ]

                             

                            // There should be an elegant solution to this rather simple problem

                            Yes – use related records instead of fields, and learn how to use Let() and List() efficiently.

                            • 11. Re: word processor tabs as opposed to field tabs
                              trm1945

                              FileMaker and Mail don't work on the same page but closer integration would be a great step in the right direction. There are lots of things I can't do yet because of simple non exposure to the problems. However, there are some very helpful people who have already been where I have yet to go and I thank you all for your help.

                              • 12. Re: word processor tabs as opposed to field tabs
                                trm1945

                                I haven't used these features before but I'll start looking at them now. Thank you, this is good stuff.

                                • 13. Re: word processor tabs as opposed to field tabs
                                  beverly

                                  And I do this many times. But that's fraught with fragility, as it depends on the receiver's email client/browser.

                                  If the "exact" needs to be there, then image/pdf is the only way.

                                   

                                  ... That is until we get RTF and/or HTML in our email with FileMaker.

                                   

                                  <sigh/>

                                  Beverly

                                  • 14. Re: word processor tabs as opposed to field tabs
                                    user19752

                                    I like mozilla and Thunderbird has command line interface to compose mail.

                                    https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options

                                    So FM can compose HTML mail using it like as

                                    ",body=" & GetAsURLEncoded("<table><tr><td>data<td>data</table>")

                                    This is 'command line' then total length may be very limited.

                                     

                                    Mail.app on OSX may be controled by Applescript.

                                    1 2 Previous Next