4 Replies Latest reply on May 22, 2013 9:16 AM by philmodjunk

    How to conditionally format within a script FMP 12

    HUNTER

      Title

      How to conditionally format within a script FMP 12

      Post

           Hi. I have many date fields for scheduling a project through several steps in editorial and design. I have a script to find the day after tomorrow in any one of these fields.

           Below is a portion of the very long script that repeats itself  for each step.

           How can I conditionally format the specific found dates to be BOLD RED to make them easy to see on the printed report?

           SCRIPT:

           Enter find mode

           Set field (Jobs:EditorialFirstDraft; get (currentDate)+2

           Set Error Capture  [On]

           Extend Found Set

           Enter find mode

           Set field (Jobs:DesignFirstComp; get (currentDate)+2

           Set Error Capture [On}

           Extend Found Set

           etc. etc.etc.

           I have this same script for 3 days out, 4 days out etc.

        • 1. Re: How to conditionally format within a script FMP 12
          philmodjunk

               Hmmm, on script could be used for 1, 2, 3, etc days out if you passed the number of days out as a script parameter

               Set Varirable [$days ; value: Get (Parameter) ]
               Set field [jobs::DesignFirstComp ; Get ( CurrentDate ) + $Days ]

               to get your color change add this line:

               Set Variable [$$Date ; value: Get ( CurrentDate ) + $Days ]

               Then you can apply this conditional format expression to all your date fields:

               $$Date = Self

          • 2. Re: How to conditionally format within a script FMP 12
            philmodjunk

                 And if you used a related table or records, one record for each date, your find script could be rewritten to be much simpler.

            • 3. Re: How to conditionally format within a script FMP 12
              HUNTER

                    Thanks so much - do you mean a related table with 365 records, one for each day of the year?

              • 4. Re: How to conditionally format within a script FMP 12
                philmodjunk

                     No, I mean a related table where you have one record for each of your "deadline" or "milestone" dates. Instead of a field for Jobs::EditorialFirstDraft and another field for Jobs::DesignFirstComp

                     You would link in a new table where you have at least three fields:

                     _fkJobsID (match field to Jobs)
                     MilestoneName (Text, stores label text such as "Editorial First Draft", "Design First Comp", etc.)
                     MilestoneDate (Date, stores the dates you are now entering in separate fields.)

                     Then you would have one related reocrd for the Editorial First Draft milestone and another for Design First Comp.

                     Then your entire find script can become:

                     Enter find mode []
                     Set field [ Milestones::MileStoneDate; get (currentDate)+ Get ( ScriptParameter ) ]
                     Set Error Capture  [On]
                     Perform Find []