3 Replies Latest reply on Sep 9, 2016 1:01 PM by philmodjunk

    Script File Path, Exporting/ Saving PDF options

    lindseym

      Good Morning,

       

      I am working on organizing my exported PDFs. I can successfully create a script that saves a certain layout, with a certain file name "Cover" in the same folder with the FMP file. Easy peasy.

       

      What I want to do, it take 1 of the PDFs and automatically save it to another folder based on the folder the FMP is in, and also grab a work order number from the record.

       

       

      Instead of working from:

       

      filemac:/Macintosh HD/Users/LR/Desktop/Filemaker Pro/Random File Name Z019293/File Maker Pro/Design/Cover.pdfScreen Shot 2016-09-09 at 9.47.56 AM.png

       

      I would like it to work backwards. So it would start in the containing folder "Design" then "File Maker Pro" find the "Drawings" folder, and save the document as [00-00 "Work Order Number From FMP"_ Cover ]

       

      This screen shot shows it as "Cover.pdf" so worst case scenario it doesn't have the work order.. but I would like to match the formatting.

      Screen Shot 2016-09-09 at 9.48.32 AM.png

       

       

       

      Thank you kindly for advice on this.

       

      Attached is my files. The current script I have is called : "Make PDF"

       

      -L

        • 1. Re: Script File Path, Exporting/ Saving PDF options
          philmodjunk

          The function Get ( FilePath ) will return the full filepath to your FileMaker File's current location including the file name. Form there, you can use text functions to get all text to the left of the "FileMaker Pro" folder name and append the Drawings folder name plus the desired file name to that to compute the desired file path.

           

          And such a variable can then be used with Save As PDF and also Export Field Contents in place of an explicit file name to specify the location and file name to use for creating the PDF or exported file.

          1 of 1 people found this helpful
          • 2. Re: Script File Path, Exporting/ Saving PDF options
            lindseym

            Sounds like that will work.

             

            It will take me a bit to test it and figure that all out but I will be sure to mark your answer as correct when I make it work!

             

            Thanks for your speedy response.

             

            -L

            • 3. Re: Script File Path, Exporting/ Saving PDF options
              philmodjunk

              Let ( [ filePath = Get ( FilePath ) ;

                        LeftPath = Left ( filePath ; Position ( filePath ; "File Maker Pro" ; 1 ; 1 ) - 1 )

                      ] ;

                        LeftPath & "Drawings/" & "NewfileNameHere.PDF"

                    )

               

              Use this with Set Variable such as: Set Variable [$Path ; value: //above calc goes here ]

               

              and then you can type in

               

              $Path

               

              as the file name and path in your Save As PDF script step.

              1 of 1 people found this helpful