July 25, 200619 yr Can anyone give me the fastest simplest way to name a "save as PDF" file using a field from the current record? All paste, etc. features are greyed out, and scripting doesn't offer any options that I can find. Thanks for your help!!
July 26, 200619 yr Set a variable (say $_output) to the exact path and name where you want to save the PDF under. (Keep in mind that FM expects the path to be in its own syntax, not the OS format) Then in the "Save as PDF" script step, in the "specify output file" dialog, just enter the name of the variable: $_output
July 26, 200619 yr Author Thanks Wim Decorte; I am having a issue with the path. My script will respond telling me that I must use a different name (the name is correct), to unlock the disk or save to a different disk. Everything I check seems to be fine. It runs, but just won't save the file... Set Variable [$_output: Value"Erdelt HD/FactTagPDFs/" & LacksFactTag::SkuSort & ".pdf"] Save Records as PDF [Restore; No dialog; "/$_output"; Current record] The actual entry in the specify= filemac:/$_output Any help?
July 26, 200619 yr You get that message when the path is incorrect, i.e., impossible to access. It looks OK to me though. I usually just put the "filemac:/" into the Variable, so I can check for platform (also so I can see it in Data Viewer; which I believe you need Advanced for). Look carefully at the names. Do you indeed have a folder "FactTagPDFs" at the top level of the drive, and is your hard drive (or mounted drive) named "Erdelt HD"? No slashes in the file name? etc.. There may be some error, but I don't see it.
July 27, 200619 yr The actual entry in the specify= filemac:/$_output No, no... In the specify output you can only have "$_output". The "filemac:/" needs to be set in your variable. The Specifiy Output File dialog is not a calculation window.
July 27, 200619 yr Author Thanks Everyone! but, I still have a path error. It names correctly, but still says that it can't save to the disk. What is the most generic path name that I can use? I tried [Get (DocumentsPath)], but no file??? If anyone has the time to look, I can try to email the script so you can see how it is set up. Thanks again.
July 27, 200619 yr You might want to create an unstored calculation field, so you can see what the result is. A common glitch is that the functions like Get (DocumentsPath) return the starting slash. So you'll get an error if you use a calculation like "filemac:/" & Get (DocumentsPath) & "file.ext", because it ends up: filemac:// (2 slashes). You could upload a clone of your file, and we can look for an error. But, because you've renamed your hard drive, your calculation will not work for anyone else.
July 27, 200619 yr Author One very important part of this that I forgot to include... I am accessing a remote database served with FMS7. What differences will that make on the naming path??? Paul
July 27, 200619 yr Well, the path is evaluated on the client. You would save the PDF onto the client machine. You'd be using FileMaker 8 on the client. So the fact that the file is hosted on FileMaker 7 I don't think would make a difference. 7 and 8 are the same file format, and it all happens on the client.
July 29, 200619 yr The two other obvious things to check are: - does the path really exist? - does the user have OS write rights to that folder?
August 17, 200619 yr So if you want to save PDF files from clients that are running a solution off of a FM server you would need a script with a custom save path for each client? Can't I just create some sort of generic path that dumps the file into the clients FM folder? The same way exporting files worked in FM5.
August 17, 200619 yr There are several Get() functions that can be used in a calculation to produce a client-specific file path: Get ( DesktopPath ) Get ( DocumentsPath ) Get ( FileMakerPath ) These produce "FileMaker syntax" paths. The final calculation of the full path, with the correct prefix and the rest of the path, can be put into a script Variable. The Variable can then be used directly in any of the Export/Import steps. There are several posts here with more specific instructions; but that's the gist of it. It is also explained in the FileMaker Help, though it may take a little jumping around to find it.
Create an account or sign in to comment