5 Replies Latest reply on Apr 9, 2015 3:16 PM by johnp1

    Open URL script command no longer opens PDF files with "file:///" protocol

    johnp1

      Summary

      Open URL script command no longer opens PDF files with "file:///" protocol

      Product

      FileMaker Pro

      Version

      13.0v4

      Operating system version

      Windows 8.1

      Description of the issue

      My FMPro database used to open URLs using the file:/// protocol with no problems.  It won't any more.  The script command opens http protocol URLs without any apparent issue.

      I am aware that the latest version is v9 but I have become wary of using the updater page when I'm skipping a version.  Earlier today I posted another report on that problem.  It's current.

      Steps to reproduce the problem

      I can go from http to file protocol URLs with relative ease, and none of the file protocol URLs will open.

      Configuration information

      It occurs to me now that the URLs in question typically include a "%" sign to replace spaces.  (this is how the original link wrote the address, and I kept the format to save time when I save it to an offline .pdf file.)

      If that is the problem, it's a lengthy and tedious workaround, but one that I can handle.

        • 1. Re: Open URL script command no longer opens PDF files with "file:///" protocol
          johnp1

          By the  way: the issue is only with .pdf files.  I have complete Web pages saved with the file:/// protocol, and they open as expected.

          • 2. Re: Open URL script command no longer opens PDF files with "file:///" protocol
            TSGal

            johnp1:

            Thank you for your posts.

            I am unable to replicate the issue.  This is what I have done:

            1. On a Windows 8.1 machine, I placed a PDF file on the Desktop.

            2. I launched Internet Explorer and dragged the PDF file into Internet Explorer to get the web address.

            3. I copied the web address (C:\Users\TSGal\Desktop\123.pdf) to the clipboard.

            4. I launched FileMaker Pro 13.0v4, created a database file with one Text field (Name) and one record (TSGal).

            5. I created a script that executed the script step "Open URL".  I pasted the URL into the formula, changed the backslashes to forward slashes, and preceded the entire string with "file:///", so it reads "file:///C:/Users/TSGal/Desktop/123.pdf".

            6. I saved the script, and then executed the script.  The PDF is displayed fine.

            Let me know what I'm doing differently than you so I can replicate the issue.

            TSGal
            FileMaker, Inc.

            • 3. Re: Open URL script command no longer opens PDF files with "file:///" protocol
              rwu2359

              it needs to be URL encoded, its a url after all

              so 'space' is replaced by %20, use FileMakers getasurlencoded on the last pat of the path

              • 4. Re: Open URL script command no longer opens PDF files with "file:///" protocol
                johnp1

                My database includes a field for URLs, and most records include URLs.

                In browse mode I have a layout that includes a "headline" , some other sorting data fields, and the URL.  

                From that list, I click on a button which executes a simple script using the Open URL script command.

                As indicated, http: protocol links work, as do links to file:/// protocol URLs that lead to saved Web Pages.

                 

                rwu2359: I'll look into that coding today.

                • 5. Re: Open URL script command no longer opens PDF files with "file:///" protocol
                  johnp1

                  @ rwu2359: GetasURLEncoded turns a space into the hexadecimal expression "%20".  The URLs in question all already use the %20 and none include spaces.

                  From FMPro 13 help:  This function removes all styles from text. All characters are first converted to UTF-8 format. Characters that are neither letters nor digits, or digits that are in the upper ASCII range, are converted to %HH format (a percent sign followed by the character’s hexadecimal value).

                  I added the GetasURLEncoded command to my OpenURL script just to be sure, and it behaved even worse (for http:// protocol URLs it opened chrome and went to my home page; for file:/// protocol URLs it does nothing)

                  And I want to repeat, this used to work for pdf files.

                  I can take the existing URL (with %20 and not spaces) and paste it into a browser and it works just fine. FMPro won't do that for .pdfs in my current scripting.

                  The script itself is very simple: (just one step)

                  Open URL [no dialog ; link ]