5 Replies Latest reply on Sep 27, 2012 8:21 AM by DavidJondreau

    Get desktop path to a folder on the desktop

      I am currently using filemaker 10 and cannot seem to figure out how to set a Path variable to go to the following location:

       

      "C:UsersUSERNAMEDesktop_MY_SCANSDocument.pdf"

       

      Here's the path I currently have:

       

      "" & Get ( DesktopPath ) & "_MY_SCANSDocument.pdf" & """

       

      This currently returns the following when I try check the path:

       

      " & Get ( DesktopPath ) & "_MY_SCANSDocument.pdf"

       

      I thought the proper way to fix this would be:

       

      "" & Get ( DesktopPath ) & "_MY_SCANSDocument.pdf" & """

       

      However when I type this in it returns the following error before I can save the path:

      The specified table cannot be found

       

      I'm unsure what I'm doing wrong, but if someone could point me in the right direction I would very much appriciate it.

        • 1. Re: Get desktop path to a folder on the desktop
          beverly

          Create a calculated field (unstored) called "myDesktop" and put just this in it, "i":

               Get ( DesktopPath )

           

          Then look at the field. Note the location of all the slashes and anything else that might be important.

           

          IF you are getting "\" as the last character, then you need not include it your path.

               myDesktop & "_MY_SCANS\Document.pdf"

           

          And if you don't get the "\" as the last character, you must include it:

               myDesktop & "\_MY_SCANS\Document.pdf"

           

          In no case should there be a leading "\". Perhaps a "file:
          " may be necessary, but generally I test without it first.

           

          HTH,

          Beverly

          1 of 1 people found this helpful
          • 2. Re: Get desktop path to a folder on the desktop
            nsabel

            What are you trying to do with this path once you have it?

             

            For example if you want to use it in an open URL it should look like this.

             

            "File:" & Get ( DesktopPath ) & "_MY_SCANS/Document.pdf"

             

            You dont need to add the extra "\" before, after or in the middle because get desktoppath returns with the leading and trailing "\" Also in filemaker you use "/" instead of "\" when specifiing paths. As you can see I changed the "\" between _MY_SCANS and Document.pdf

             

            Nick

            1 of 1 people found this helpful
            • 3. Re: Get desktop path to a folder on the desktop
              beverly

              I try to test for platform and use the correct "/", "\", ":" as needed.

              I think that now-a-days even Windows understands "/" in the path, but I could be in error!

               

              Nick is correct, it may depend on what you are doing with it. Once the path is created, are you reading (import)? writing (export)? viewing (pushing to email, open in web viewer, or other)?

              • 4. Re: Get desktop path to a folder on the desktop
                nsabel

                I think that now-a-days even Windows understands "/" in the path, but I could be in error!

                Yes Beverly you are right. I'm on Windows and for most tasks internal to filemaker it understands "/" in the path. However if you use the Send Event script on windows to manipulate the system via the command prompt make sure any paths you feed it use "\". Just another example of how it all depends on the use.

                 

                Nick

                • 5. Re: Get desktop path to a folder on the desktop
                  DavidJondreau

                  Backslash is an escape character in FileMaker. If you want a backslash to appear in a quoted string, you need to escape it...with another backslash. When you're mixing in escaped quotes, it can get pretty confusing.

                   

                  It's unclear what you want as a filepath (and I think you may be overthinking it). But if you want a double quote as the initial character in your string, it's "\"". If you want a backslash as you're initial character, it's "\\".