1 Reply Latest reply on Jan 21, 2011 2:01 PM by DennisPrickett

    Opening pdf file from container in Windows 7

    DennisPrickett

      Title

      Opening pdf file from container in Windows 7

      Post

      I have a document archive "Document Library", in which a container field  "File" holds a pdf file.  When I want to view the pdf file, I run the following script:

      • Set Variable [$path; Value:"filewin:" & GetAsText (Document Library::SavePath) & GetAsText (Document Library::File)]
      • Export Field Contents [Document Library::File; "$path"; Automatically open]

      This saves the pdf fild to a disk and sends a message to open the file.  The script runs fine and opens the file on a machine running XP, on a Mac OSX machine, even on my iPad running Filemaker Go.  But, it will not open the file on a machine running Windows 7.  In this machine, the script runs, saves the file to the temp location, and then nothing happens.  I've tried it with Acrobat Reader already up and not running, with no difference.

      I've also tried: Send Event ["aevt"; "odoc"; $path]     to no avail.

        • 1. Re: Opening pdf file from container in Windows 7
          DennisPrickett

          I figured this out.  Apparently Windows 7 won't automatically open the pdf file or handle the Send Event commands to open it directly.  I wrote the following script to export the file and then send a command through CMD to open the file.  It looks like this:

          • Set Variable [$path; Value:"filewin:/j:/temp/" & GetAsText (Document Library::File)]
          • Set Variable [$path2; Value:"j:/temp/" & GetAsText (Document Library::File)]
          • Set Variable [$cmd; Value:"cmd /c start acroRD32.exe " & $path2] -- comment - note the space after the .exe
          • Export Field Contents [Document Library::File; "$path"]
          • Send Event ["aevt"; "odoc"; $cmd]