4 Replies Latest reply on Aug 15, 2017 5:53 PM by poiron

    Get Directory cancel button


      I'm trying to capture the error message that results when a user clicks the cancel button in the Get Directory dialog box. I've tried error code 1 (user canceled action) but that does not seem to work. Has anyone tried to do this? I'm trying to avoid the Filemaker message that comes up when a user clicks this cancel button and to exit a script instead.

        • 1. Re: Get Directory cancel button



          Thank you for your post!


          I was unable to experience any additional dialog windows when running the following script:

          Set Error Capture [ On ]

          Set Variable [ $Path ; Get(DesktopPath) ]

          Get Directory[ Allow Folder Creation ; $i ; "test" ; $path


          When ran and clicking Cancel, it does return Error 1.


          I added an IF line to check for Get(LastError) = "1" and it also seemed to work as expected. Do you have any further information we might use to reproduce?


          I'm also going to move this thread from the FileMaker Community Feedback Space (which is specifically for input on the Community itself) to the Discussions Space where you should receive more views and potentially more feedback on this topic!



          FileMaker, Inc.

          • 2. Re: Get Directory cancel button

            I also tried to use an IF statement after the Get Directory to put up a custom dialog box if the cancel button is clicked but it does not seem to capture. It otherwise works as needed for the moment. I am on FMP 14 Advanced, mac OS 10.12.5 if that makes a difference.

            • 3. Re: Get Directory cancel button

              Actually this is a problem. As it does not capture with an IF statement it goes to my ELSE statement and prints the PDF in the same directory as the solution file. Not sure what else to try.


              Filemaker Pro 14 Advanced 14.0.6.

              • 4. Re: Get Directory cancel button

                Figured it out. I had a script step between the Get Directory and the IF statement and so the last error code was based on a script step that was in fact working.