6 Replies Latest reply on Feb 16, 2010 12:31 PM by RickWhitelaw

    Script making PDF and naming it according to the record

    onamac

      Title

      Script making PDF and naming it according to the record

      Post

      I followed these instructions for making and dynamically naming a PDF from a record:

       

      http://filemaker.custhelp.com/cgi-bin/filemaker.cfg/php/enduser/std_adp.php?p_faqid=7013&p_created=1224110348&p_sid=NddCaEUj&p_accessibility=0&p_redirect=&p_lva=&p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9OTcsOTcmcF9wcm9kcz04NjQmcF9jYXRzPSZwX3B2PTEuODY0JnBfY3Y9JnBfcHNfYW5zX3VwZGF0ZWQ9JnBfcGFnZT0xJnBfc2VhcmNoX3RleHQ9UERG&p_li=&p_topview=1

       

      When I do this verbatim (using my info), it appears that the file is being made but it is saved no where (I did a search). Now, when I don't use $filePath, I enter where I want it to be saved, it does save there, but not with the title. If I put in "output file. specify" the path and no file name, I get an error message when trying to run the script:

       

      "Song Lyric PDFs could not be created on this disk. Use a different name, make more room on the disk, etc."

       

       I've also tried filemac. Do I use this Get (DesktopPath) or am I supposed to fill that in with something?

       

      Thanks! 

        • 1. Re: Script making PDF and naming it according to the record
          philmodjunk
            

          Are you using Mac, Windows, or Both?

           

          Get (DesktopPath) is a get function that returns the file path to your current desktop folder. Using this file path in a correctly formatted calclulated file path, should cause the PDF to be saved directly to your desktop.

           

          "... could not be created on this disk. Use a different name, make more room on the disk."

          is Filemaker's message telling you that it tried to save your PDF to the specified filepath but it failed for some reason. Nine times out of ten, that error pops up because some picky little detail in your computed file path isn't quite right--so I'd check over your file path very carefully. I don't know if mac systems have to have Filemac: as the first item in the path, as I don't have a Mac system available to test, but it certainly won't fail if you include it for saving a PDF to a Mac directory...

          • 2. Re: Script making PDF and naming it according to the record
            onamac
              

            Mac. Here's what I have:

             

             Set Variable [$filePath; Value: Get (DesktopPath) & Lyric Sheets(double colon)PDFName & ".pdf"]  (but typing a double colon here is giving me a smiley face)

             Save Records as PDF [Restore; No dialog; "$filePath"; Current record]

             

            I've also substituted the $filePath by selecting an actual path via the "Specify output file". However upon navigating there, it insists there be a save as file name, which by default is "Untitled.pdf". So the PDF does get saved there, but is named "Untitled.pdf". In the formula I've taken off the last /Untitled.pdf but then I get the error message I mentioned before.

             

            I don't want the PDFs to be saved to the desktop but rather elsewhere.

             

            I'm trying to figure out how to keep the path but get the file to name itself. I'm wondering if there are things in the above script that need to be replaced with actual data?

             

            If I replace Get (DesktopPath) with Get..., what would be used in there? I tried putting a whole path but it rejected it. 

            • 3. Re: Script making PDF and naming it according to the record
              RickWhitelaw
                

              I use a Mac, 10.6.2.

               

              Try:

               

              Set Variable[$TITLE;Value;your value]

              Save Records as PDF[Restore;no dialog;"$TITLE";Records being browsed]

               

              "Records being browsed" may not be  what you want . . . set it how you like.

              Your $filepath variable should be  entered in the "Specify Output File" dialog. On a Mac "file:../../../Desktop/$TITLE" would put the file on your desktop without using another variable. If you like, enter other path values in place of ".." .

               

              RW 

              • 4. Re: Script making PDF and naming it according to the record
                onamac
                  

                Thanks. Please bear with me; I need to ask this just to be clear, because I'm not that familiar with scripting yet.

                 

                What is $TITLE representing, and am I supposed to write "TITLE" like you did, or replace "TITLE" with a filename of my own/which?

                 

                And when you say "value; your value" -- which value of mine are we referring to that I'm to replace that word with?

                 

                Naturally I don't expect you to know my file names or hard drives, but I'm just asking if any of these indicators in the script are to be replaced by my own personal data, what kind of data are they standing for so that I will know what to replace them with?

                 

                Thank you! 

                • 5. Re: Script making PDF and naming it according to the record
                  user14360
                    

                  Just wanted to add that when I have had that error message come up for me, it was when I had a number as the beginning of the filename variable.  Once I changed that, it sorted itself out.

                   

                  I'm on Mac OSX, Filemaker Pro 10 Advanced.

                  • 6. Re: Script making PDF and naming it according to the record
                    RickWhitelaw
                      

                    Look up the "Set Variable" script step in help. Then look up "Save Records as PDF". All will be explained.

                     

                    RW