Erdelt Posted July 25, 2006 Posted July 25, 2006 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!!
Wim Decorte Posted July 26, 2006 Posted July 26, 2006 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
Erdelt Posted July 26, 2006 Author Posted July 26, 2006 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?
Fenton Posted July 26, 2006 Posted July 26, 2006 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.
Wim Decorte Posted July 27, 2006 Posted July 27, 2006 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.
Erdelt Posted July 27, 2006 Author Posted July 27, 2006 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.
Fenton Posted July 27, 2006 Posted July 27, 2006 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.
Erdelt Posted July 27, 2006 Author Posted July 27, 2006 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
Fenton Posted July 27, 2006 Posted July 27, 2006 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.
Wim Decorte Posted July 29, 2006 Posted July 29, 2006 The two other obvious things to check are: - does the path really exist? - does the user have OS write rights to that folder?
HALBURN Posted August 17, 2006 Posted August 17, 2006 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.
Fenton Posted August 17, 2006 Posted August 17, 2006 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.
Recommended Posts
This topic is 6675 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now