4 Replies Latest reply on Aug 10, 2017 2:56 PM by chivalry

    Perform Script on Server empty Get( SystemDrive ) and others

    JEDtech

      Product and version FileMaker Server 16

      OS and version Mac OS X 10.11.6

      Hardware Mac Pro 2009

      Description

      (thanks to Vincenzo Menanno for identifying the problem)

       

      When running a script on FileMaker Server via Perform Script on Server some Get() functions fail to return a value.  Known problems include:

       

      Get( DesktopPath )

      Get( FileMakerPath )

      Get( SystemDrive )

       

      There may be others.  See screen-shots below of same script run from FileMaker Pro Advanced 16.0.1 against FileMaker Server 15.0.3 and FileMaker Server 16.0.1

       

      Screen Shot 2017-05-25 at 5.34.11 PM.png

       

      Screen Shot 2017-05-25 at 5.37.32 PM.png

       

      How to replicate

      Run a script via Perform Script on Server [Wait for results] that returns the problematic Get() commands.

       

      Workaround (if any)

      It is possible to parse the working Get( DocumentsPath ) to derive DesktopPath, FileMakerPath, and to guess at SystemDrive.

        • 1. Re: Perform Script on Server empty Get( SystemDrive ) and others
          TSGal

          JEDtech:

           

          Thank you for your post.

           

          In FileMaker Pro 16 Help for Get (DesktopPath), it says, "In server-side scripts, the Desktop folder is not supported, so this function returns unreliable results. Instead, paths must use the Documents folder or temporary folder."

           

          Help for Get (FileMakerPath) - "In FileMaker WebDirect, this function is not supported and returns an empty string."  Although this doesn't specify Perform Script on Server, WebDirect uses the server to get information.

           

          Likewise, Help for Get (SystemDrive) - "In FileMaker WebDirect, this function is not supported and returns an empty string."

           

          I have sent this information to our Product Documentation department so this can be addressed in future documentation.

           

          TSGal

          FileMaker, Inc.

          1 of 1 people found this helpful
          • 2. Re: Perform Script on Server empty Get( SystemDrive ) and others
            nickorr

            TSGal,

             

            The documentation for the Get (SystemDrive) function doesn't mention that it doesn't work on server side scripting, and this did work in 15.  I can see why the desktop function doesn't work, but I can see legitimate uses for the SystemDrive one.

             

            So is this a deliberate change that Get (SystemDrive) is no longer supported in FMS 16 ( so the docs need to be updated ) or is this a bug that it should work like it did before ( in which case this is a bug report.

             

            Thanks,

            Nick

            1 of 1 people found this helpful
            • 3. Re: Perform Script on Server empty Get( SystemDrive ) and others
              TSGal

              nickorr:

               

              Due to software security, Get (FileMakerPath), Get (SystemDrive), Get (DesktopPath) and Get (PreferencesPath) now return empty when run via server side.

               

              Our Product Documentation department is aware of this change and should be addressed in future documentation.

               

              TSGal

              FileMaker, Inc.

              3 of 3 people found this helpful
              • 4. Re: Perform Script on Server empty Get( SystemDrive ) and others
                chivalry

                I just tripped over this and would suggest that, as Nicholas says, there are legitimate reasons for needing to know the system drive name while running a script server side. For now, the following custom function works, at least on macOS:

                 

                Let (

                  [

                    _doc = Get ( DocumentsPath ) ;

                    _comps = Substitute ( _doc ; "/" ; "¶" ) ;

                    _name = GetValue ( _comps ; 2 ) ;

                    _system_drive = "/" & _name & "/"

                  ] ;

                  _system_drive

                )