5 Replies Latest reply on Dec 1, 2015 5:55 AM by f.i.sciences

    save as pdf default path




      Using command 'Save as PDF', I would like to let the user specify where to save the file but starting with a default path that I provide and default file name.


      Can we do that? Or part of it?


      Thank you.

        • 1. Re: save as pdf default path



          No really good ways (i.e. user-resistant, unbreakable) but you could present a dialog box with an input global field where you provide the user with a fully realized filepath.  Then you could allow the user to tweak it (assuming they understand how these paths work).  You could then append their path to your filename, feed it to a variable and see what happens.  The output path needs to be real path otherwise you'll get a "File can not be created..." error.


          Must admit it sounds like a lot of potential complications.



          • 2. Re: save as pdf default path

            Using FileMaker 14's 'Get Directory' script step, this is mostly possible... In that script step you can specify a default path, and then append your default file name to the result, and use 'Save as PDF' (with no dialog) to save the pdf to that location.


            The script would be something like:


            Get Directory [ Allow Folder Creation; $path; Default Location: Get(DesktopPath) & "/MyPDFs" ]

            Set Variable [ $path; Value:$path & "mypdf.pdf" ]

            Save Records as PDF [ Restore; No dialog; "$path"; Records being browsed ]

            This assumes that the 'MyPDFs' folder already exists on the Desktop. If not, then I think it defaults back to the last used directory.

            In this example, the file name of mypdf.pdf' is hard coded in, though you could use another method (e.g. a field value) to set the file name.


            • 3. Re: save as pdf default path

              I forgot to say that I dont want the options dialog to appear. Only the save as.

              • 4. Re: save as pdf default path

                Did you have a go at the method I described above? The only dialog shown to the user is the 'Get Directory' one, where the user chooses where to save the PDF in the same way the 'Save as' dialog works..?

                1 of 1 people found this helpful
                • 5. Re: save as pdf default path



                  How did I miss that GetDirectory() function!


                  Thank you.