8 Replies Latest reply on Nov 30, 2011 7:26 AM by campfire

    Get (Document Path) returns /C:/Users/Administrator/Documents/

    campfire

      Need to import a tab delimited file (Location is ........Filemaker Server/Data/Documents) by running a FMS script to refresh/update a table. However, Get (Document Path) returns /C:/Users/Administrator/Documents/. this is on Windows Server 2008..... What am I doing wrong here?

        • 1. Re: Get (Document Path) returns /C:/Users/Administrator/Documents/
          BruceHerbach

          The get(documents path) returns the ducuments path of the user environment.

          So when run as a server side script you get the results you saw.

          When run from a client it should produce the results you wanted.

           

          For the server side script to work put the file to be imported

          In the location that get(document path) returns on the server

          Script. 

           

          Hope this helps

          Bruce Herbach

          • 2. Re: Get (Document Path) returns /C:/Users/Administrator/Documents/
            campfire

            Bruce,

            When I do access the db as a client from the server desktop using Remote Access and debug the script... I’m still unable to map fields.  Perform without Dialog is not checked.  What am I missing......

             

            ?????

             

            Greg

            • 3. Re: Get (Document Path) returns /C:/Users/Administrator/Documents/
              ariley

              In my experience it's best to hardcode the file path in a $_file variable, because then you know exactly what you're getting. You should separate that into 2 (Mac, Windows) or 3 (Mac, Windows and Server) depending on what you're trying to achieve.

              • 4. Re: Get (Document Path) returns /C:/Users/Administrator/Documents/
                RayCologon

                campfire wrote:

                Need to import a tab delimited file (Location is  ........Filemaker Server/Data/Documents) by running a FMS script to refresh/update a table.  However, Get (Document Path) returns /C:/Users/Administrator/Documents/.   this is on  Windows Server 2008.....   What am I doing wrong here? 

                 

                Hi Greg,

                 

                Why are you concluding that Get(DocumentsPath) is returning "/C:/Users/Administrator/Documents/"?

                 

                That's the string one would expect it to return when the file is opened by a FileMaker client application (while logged in as "Administrator") whether running on the server machine or a client workstation. However, when the function is evaluated by the FileMaker Server application, it should return the path to ...Filemaker Server/Data/Documents on the server machine.

                 

                Unless you are having a server-side script write out the result of the Get(DocumentsPath) function to a data field that you can then view from the client application, you wouldn't be able to tell what path FMS is "seeing".

                 

                campfire wrote:

                When I do access the db as a client from the server desktop using Remote Access and debug the script... I’m still unable to map fields. Perform without Dialog is not checked.

                 

                If the "Perform without dialog" option is not checked, the step will be skipped when the script runs on FMS, since FMS does not display dialogs.

                 

                Meanwhile, when you access the database from FMP (or FMPA) on any machine including the server itself, you should expect Get(DocumentsPath) to return the path to the documents folder in/C:/Users/, not to the FMS documents folder, so unless you've put a copy of the tab delimited file into /C:/Users/Administrator/Documents/ for testing purposes, you should expect the step to fail.

                 

                Regards,

                Ray

                ------------------------------------------------

                R J Cologon, Ph.D.

                FileMaker Certified Developer

                Author, FileMaker Pro 10 Bible

                NightWing Enterprises, Melbourne, Australia

                http://www.nightwingenterprises.com

                ------------------------------------------------

                • 5. Re: Get (Document Path) returns /C:/Users/Administrator/Documents/
                  BruceHerbach

                  Greg

                   

                  The issue is the userid.  When you log into the server and run get(desktop

                  path). It gives you the path for your userid and not the system account.

                   

                  Try this...  Create a field to hold the path,  then create a script that

                  stores the system desktop path in the field.

                   

                  Once you have then store the data files in the selected folder.

                   

                  For development put the file in your desktop path.  This will let you do

                  the field mapping and run the script server side.

                   

                  If you need more help with this please contact me back channel.

                   

                  Bruce Herbach

                   

                  Sent from my mobile device... Please excuse typos.

                  • 6. Re: Get (Document Path) returns /C:/Users/Administrator/Documents/
                    campfire

                    Thanks for your help....  I finally wrote the path to the FMS Documnet folder.  Working great. Thanks Greg

                    • 7. Re: Get (Document Path) returns /C:/Users/Administrator/Documents/
                      campfire

                      Thanks for your help....  I finally wrote the path to the FMS Documnet folder.  Working great. Thanks Greg

                      • 8. Re: Get (Document Path) returns /C:/Users/Administrator/Documents/
                        campfire

                        Thanks for your help....  I finally wrote the path to the FMS Documnet folder.  Working great. Thanks Greg