Naming a PDF dynamically from a field within my file: PART 2
I have a database that produces invoices. I'd like to be able to save each invoice as a pdf with the invoice number in the name. I need to be able to save this pdf file in a specific folder in my business documents.
An older post from 2011 named,"Dynamically naming a PDF" addresses the issue of saving a PDF with a name from a field such as an invoice number.
It works great, but only saves to the desktop. It uses the "Get (DesktopPath)" function within the variable options. I've found a list of "Get" functions and none seeem to allow for a specific folder path.
Is there a way to make this kind of script work, but be able to save to a specific folder?
Below is the script that saves to the desktop only:
The following example assumes that your file is named 'MyFile' and the field that is used to name the PDF is 'PDFName'.
Create the following script:
Set Variable (*see set variable options below)
Save Records as PDF [Restore; No dialog; "$filePath"; Current record]
*Set Variable Options:
Value: Use one of the following formulas
Get ( DesktopPath ) & MyFile::PDFName & ".pdf"
"filewin:"& Get ( DesktopPath ) & MyFile::PDFName & ".pdf"
Mac and Windows:
Choose ( Abs ( Get ( SystemPlatform ) ) -1 ; Get ( DesktopPath ) & MyFile::PDFName & ".pdf" ; "filewin:"& Get ( DesktopPath ) & MyFile::PDFName & ".pdf" )