5 Replies Latest reply on Mar 14, 2017 12:09 PM by sdurante

    Can I set answers to dialogues in script?

    sdurante

      I have a script that imports a just-entered record into another table. Then is deletes the record from the original table.
      The problem is that I'd like the script to run without dialogues and that's not an option for importing records. I'd like to set the dialogue answers to ARRANGE BY "matching names" and IMPORT ACTION "add new records."

      I'm using FM7.

        • 1. Re: Can I set answers to dialogues in script?
          philmodjunk

          If you can insert files into container fields with the "store a reference" option, and if you have variables, you can do this without the dialogs. But I don't know if that's true for FileMaker 7 as that's a very, very old version of FileMaker that I "skipped", jumping from 5.5 to 10. I thus don't know if you can use variables in a script in that version.

           

          If you can, you can use insert file to insert the file from which you want to import into a container field using the "store a reference option", then the script can extract the file path for the file from the container field and set a variable to it. This variable can then be used to specify the file in the Import Records script. (You'll also need to add a valid working file reference to an actual file when setting up the script step listed below the variable.) You can then keep the dialogs from appearing and have the field mapping options stored in the script step.

           

          But I have my doubts that you can do this in FileMaker 7.

          1 of 1 people found this helpful
          • 2. Re: Can I set answers to dialogues in script?
            sdurante

            I was afraid of that. There's no SET VARIABLE command in FM7's Script steps reference so I guess I can't do it.

            I'm engaged in a proof of concept right now and if it works as well as it looks like it will, I'll upgrade and make my life simpler.

            • 3. Re: Can I set answers to dialogues in script?
              wimdecorte

              Instead of importing, why not read the data and create the record with "new record" and "set field"?  That would get you around it.

               

              Having said that; the import script step lets you specify the options to not have a dialog.  Is that not working for you?  If not, can you post a screenshot of your script?

              • 4. Re: Can I set answers to dialogues in script?
                wimdecorte

                sdurante wrote:

                 

                I'm engaged in a proof of concept right now and if it works as well as it looks like it will, I'll upgrade and make my life simpler.

                 

                I wouldn't do a PoC in an old version because it may lead you to decide that it can't work.  You're using a 13-year old version...

                 

                Why not use the FMP15 trial instead?

                • 5. Re: Can I set answers to dialogues in script?
                  sdurante

                  Here's the script.

                  I see now the default(?) in the first step is "update matching" which I've been changing to "add new records" when the dialogue appears. Can I add "Arrange by matching names" somehow as well? Also, in fact there is a "perform without dialogue" option for this step. If I can set it in the . . .

                  Wait a minute: I see now that when I edit the script step I can specify BOTH items and it saves it.

                  And. . . it works with no pause/dialogues, not even the one about auto-entering data options in the imported record. It auto-entered those and that's what I want.

                  THANKS!