2 Replies Latest reply on Apr 6, 2017 10:27 AM by danjamins

    Running Script From FMP App To Create Folders on Fileserver

    danjamins

      Hi all,

       

      I have a simple task to accomplish but am wondering the best way to go about it.

       

      Solution Details / Problem Space

      1. In the solution there is a table for "Projects" which has a field "ProjectNumber" that generates a unique number for each project
      2. We have a network file server that is used for these Projects to store documents that we don't want in container fields (like uploading 1000's of photos at a time, much easier in windows to drag and drop)
      3. Currently these folders are manually created and the sub-folders within those are touched by so many hands that the naming structure is very inconsistent

      Goal

      My goal is to write a script (hopefully in python or powershell or another language) that will grab the value of ProjectNumber and create a folder in the file server with a standard set of sub-folders when the user clicks on the project number field in the FMP app. It will create the folder if it doesn't exist first, if it does already exist it will open the folder so the user can browse through it.

       

      Previous Solution

      I have built this before using batch scripts, but it's clunky and has it's limitations. It also required the users have the batch script on their local machine in order to call it. I'm wondering if the same functionality is possible with PowerShell or Python. I'd prefer Python but either will be fine if possible.

       

       

      Thank you for your time and hopefully the answer to my little problem

      -Dan

        • 1. Re: Running Script From FMP App To Create Folders on Fileserver
          philmodjunk

          It also required the users have the batch script on their local machine in order to call it

          You can insert the batch field into a container and use Export Field Contents with the "Open on export" option specified to automatically execute the batch file at the same time. Another script step can delete the exported file or, if security protocols permit, you can export to the temporary folder and not need to delete the batch file.

           

          Export Records can also be used and this provides the option to include data from your database, such as your product number, as part of the command lines that make up the batch file.

           

          The same methods can be used to create and execute a VBScript file

          1 of 1 people found this helpful
          • 2. Re: Running Script From FMP App To Create Folders on Fileserver
            danjamins

            Thanks phil. Figured another way to do it through native filemaker send event commands to cmd. It works great.