0 Replies Latest reply on Apr 3, 2011 7:09 AM by user14336

    Save Dynamic PDFs to DropBox Folder

    user14336

      Title

      Save Dynamic PDFs to DropBox Folder

      Post

      A SCRIPT to save PDF's to your MacOSx DropBox folder using field data to uniquely name each PDF file.

      (assumes DropBox folder is in its default location) 

      Set Variable [$filePath; Value: Substitute ( Get (DocumentsPath) ; "Documents" ; "DropBox/" ) &TABLE::FIELD &".pdf"]

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

       

      The filePath variable returns the path to the Documents folder, and Substitute then replaces this with the DropBox folder. The fields you wish to append go at the end, each preceded with the & symbol and finally the .pdf extension.

      However, you may wish to save files to a sub-folder within DropBox.

      e.g. let's imagine you have a billing database and want to save pdf copies of invoices sent to your clients.  Rather than cluttering up the DropBox folder, you create a folder called "INVOICES "within it.

      You have a table called "CLIENTS" with fields that include "Surname", "InvoiceRef" and "InvoiceDate".

      In this example we want to save the pdf files in the format:  "Surname_InvoiceRef_InvoiceDate.pdf" each into the INVOICES folder within DropBox.

      Here's the script:

      Set Variable [$filePath; Value: Substitute ( Get (DocumentsPath) ; "Documents" ; "DropBox/INVOICES" ) &CLIENTS::Surname &"_" &CLIENTS::InvoiceRef &"_" &CLIENTS::InvoiceDate &".pdf"]

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

       

      Current record ensures only one client's invoice is saved into each pdf file.

      Stephen

      PS perhaps someone could post modification for windows users as only use OSX.