Save Record as PDF
I created a button to save my record as a pdf. Is there a way to automatically name the file? For example i have a field Proposal Number. I want my pdf to be saved as that number.
And you can also specify where to save the PDF at the same time.
See this thread: Found Sets to PDF with unique file names
Can you take a look and see what i am doing wrong I have tried the following
"file" & Get (Filemac:/LIonS/Users/kent/Documents/Proposals/PDF) & Proposals::Proposal Number & ".pdf"
"file" & Get (LIonS/Users/kent/Documents/Proposals/PDF) & Proposals::Proposal Number & ".pdf"
"file" & Get Filemac:/LIonS/Users/kent/Documents/Proposals/PDF & Proposals::Proposal Number & ".pdf"
"file" & Get LIonS/Users/kent/Documents/Proposals/PDF & Proposals::Proposal Number & ".pdf"
Filemac:/LIonS/Users/kent/Documents/Proposals/PDF This is the directory I am trying to store my .pdf files into
I tried this using (DesktopPath) and it said "P14-0028.pdf" could not be created not this disk use a different name, make more room on the disk, unlock it or use a different disk.
No need for a Get function here. The examples use a Get function--something that you should look up in FileMaker Help as it is a very useful function--in order to generate a file path to a standard folder location in a way that works on any mac or windows computer.
If you are going to explicitly specify the file path, use:
Set Variable [ $Path ; Value: "file:/LIonS/Users/kent/Documents/Proposals/PDF" & YourFileName.PDF goes here ]
In place of "YourFileName.PDF goes here", you can put literal text in quotes or compute the file name from functions and fields.
PS, not being a current Mac user I don't know if the beginning of your file path should be file:/LionS or file:LionS.
For more on $Path variables and the scripts that can use them: Exploring the use of a $Path Variable in Scripts
I've tried it with & ".pdf" and without i keep getting the same message
Since PDF is a folder name, the end of that quoted text should be /PDF/ & "
I still get the same error message as before, with the exception of the PDF proceeding it.
Which indicates that the file path to the file is not valid. All it takes is one character in the wrong place. Even incorrect capitalization of the "tag" at the start (file: ; filemac ; filewin...) is enough to be an issue here.
I suggest downloading the FilePathExtractor file and inserting a file (any file) from your PDF folder, with the "store a reference" check box selected, into the container field in that file. Then click the Literal File Path tab and you'll find a field that has extracted the actual file path to that file. You can then copy and paste that file path (all but the file name) into your set variable expression to be sure that you have a valid file path to the PDF folder so that all you need add is the expression for the file name.
thank you for your help. I tried that and still get the same error, i even tried the desktop and other paths.
In reviewing your earlier screen captures, I don't see the file extension ".PDF" on your file names. Looks like you need to add & ".PDF" to the end of your FilePath calculation.
Take a look at this post, it has good example of how to do this on windows or mac
Script example for MAC or Windows that makes a directory using Command line or AppleScript
What happens if you use:
"file:" & Get ( DesktopPath ) & "Test.PDF"
Does that work?
If it does not, please post the entire script as you now have it.
It did not work either
Try this I modified it to your .pdf export. It works for me.
this will put the file in a folder it creates on your desktop PDF_Files. You will get an error I think 800 the first time while it creates the directory, run the script again and it will create the file.
Retrieving data ...