7 Replies Latest reply on Jul 30, 2013 2:22 PM by philmodjunk

    Save Records as PDF issue ...

    pbedouk

      Title

      Save Records as PDF issue ...

      Post

           Hi ... I can't seem to get the premissions right to save a pdf to disk when using variables to create a filename.

           If I 'Specify Output File' directly in the Save Records as PDF script step, it works. If I create a $variable with get (DesktopPath) and use that in the Save Records as PDF script step, it doesn't work.  Here's the script:

             
      •           Set Variable [ $OrdersFolder; Value:"File:" & Get (DesktopPath) & Distributors::Name & " " & Get (CurrentDate) ]
      •      
      •           Save Records as PDF [ File Name: “$OrdersFolder”; Automatically open; Records being browsed ]

            

           Any thoughts?

           Using Mac OS 10.8, FM 12

      Error_Message.jpg

        • 1. Re: Save Records as PDF issue ...
          philmodjunk

               Since you are saving to your desktop, it isn't likely to be a permissions issue despite the error message you are getting. More likely the path or file name is incorrect when you get such a message. Your file path looks correct, but Get ( CurrentDate ) may be returning characters that are not permitted in a file name and you've left off the ".PDF" file extension.

               I use this expression for computing a file name that includes the Date:

               Distributors::Name & " " & Substitute ( Get (CurrentDate) ; "/" ; "-" ) & ".PDF"

               For those reading this thread that are interested in learning more about how to work with $Path variables in FileMaker scripts and container fields: Exploring the use of a $Path Variable in Scripts

          • 2. Re: Save Records as PDF issue ...
            pbedouk

                 Thanks for your quick response!  Unfortunately it still doesn't work. I made the filename "A.pdf", and displayed $OrdersFolder in a custom dialog (shown below).  Nothing odd about the path or name that I can see.  I get the same error message however.  

                 Current script:

                   
            •           Set Variable [ $OrdersFolder; Value:"File:" & Get (DesktopPath) & "A.pdf" ]
            •      
            •           Show Custom Dialog [ Title: "File Path etc..."; Message: $OrdersFolder; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
            •      
            •           Save Records as PDF [ File Name: “$OrdersFolder”; Automatically open; Records being browsed ]

                  

                 Still get the same error (with the new filename)

                  

                  

                  

            • 3. Re: Save Records as PDF issue ...
              philmodjunk

                   Ok, this one is incredibly subtle. Use file: instead of File:.

              • 4. Re: Save Records as PDF issue ...
                pbedouk

                     Good grief.  Is this a bug? Get (DeSkToPpAtH) works and fILE works, but File doesn't???

                     Thank you again!

                • 5. Re: Save Records as PDF issue ...
                  philmodjunk

                       It's never, to my knowledge, been reported as a bug, but feel free to use Report An Issue to do that if you want.

                  • 6. Re: Save Records as PDF issue ...
                    pbedouk

                         Before I do, are you aware of any other 'word' in the Filemaker lexicon that is case sensitive? Is this something I 'should have known'??

                    • 7. Re: Save Records as PDF issue ...
                      philmodjunk

                           I've used FIleMaker Pro since 2.5 and didn't know that file: (and imagemac, imagewin, etc.) was casensitive until I was banging my head on the same wall a couple of years ago. Very few items are case senstive in FIleMaker. Passwords and SQL text expressions are the only two other cases that come to mind.