2 Replies Latest reply on Oct 29, 2009 3:07 PM by ishulman

    Dynamic Scriptwriting

    ishulman

      Title

      Dynamic Scriptwriting

      Post

      Hi. I'm using Filemaker Pro 9 with Mac OS 10.5.8 (Leopard).

      I have a health practice and put out quarterly mailings to a variety of other health providers. I would like to create a scripting system that allows me to choose from a list of health provider specialties and then proceed to print address labels/envelopes. Example: In January I might want to target only psychiatrists, psychologists and family doctors. In April I might want to target family docs and social workers, etc.  My thought was to create a layout that lists all the different specialties with check-boxes/radio buttons that, when checked, will create a script to find records that match those various criteria.

       

      Other than creating one script for each of what might be hundreds of combinations of specialties, can anyone suggest a way to achieve this?

      Thanks,
      ishulman

        • 1. Re: Dynamic Scriptwriting
          philmodjunk
            

          Much depends on exactly how you have defined your tables/relationships, but a single script can process the user selections to pull together a matching found set of records.

           

          One General hint:

          Make the fields on your "search layout" global fields (Click the storage tab under field options when you define the fields). The values in these fields will remain available to your script even after it enters find mode.

           

          Your script might have this general format:

           

          Go To Layout [Select a layout that refers to the table you want to search]

          Enter find mode []

          Set Field [YourTable::YourField; YourTable::GlobalSearchField]

          #do such a set field step for each field you want to enter search criteria

           

          Set Error capture [on]

          Perform Find []

          Set Error capture [off]

          # set error capture prevents the Filemaker's "Records not found" dialog from interrupting the script if no records are found

           

          If [get ( foundcount ) > 0 ]

            Go to layout [Specify the layout from which you want to print]

            #add any other steps here that you want for working with you new found set

          Else

            Show Custom Dialog ["No records were found..."]

          End IF

           

          • 2. Re: Dynamic Scriptwriting
            ishulman
              

            Thanks again Phil. I'll try that.

            BTW, still working on my last FM issue (re. passwords). Spent a few hours on the phone with FIlemaker and Apple about it. There are still some other, systemic issues going on with the machine and it's been at the shop since Saturday but, so far, running a disk defragmenter appears to have resolved the issue with the one database opening without a password.

            I appreciate your ongoing willingness to answer my questions.

            Ian Shulman