February 21, 200817 yr Hi there! Any ideas out there for this one? I have a script that Saves Records as PDFs using a filename that encorporates several fields from the record. I am trying to create some security in the script so that if a PDF with that particular filename already exists, that it is NOT overwritten. So before the Save Records as PDF script step is intiated, I used the Insert File step with the filename to insert the file in a global container field. Then used the Get(LastError)=0 and used the Else to show a custom dialog message warning that the file exists and then exits the script before getting to the Save Records command. It works well if the PDF file does exist...BUT if the PDF file doesn't exist yet, then the Insert File step comes up with a window prompting that the user specify a file location . One then has to click "CANCEL" before the script continues to generate the PDF file (which it does fine). I am trying to get rid of this prompt for a file location or maybe there is a better way to go about this task???
February 21, 200817 yr Where are you saving your PDFs? Are they being saved in container fields, being referenced by a container field, or just sitting out on some server?
February 21, 200817 yr Author Actually we have a contract with one of our customers that requires that we save a PDF of our documents that we send. So they just sit out there on our server for the customer's auditing/backup requirements. That is just what they require. Hence the importance of not accidentally overwriting the PDF files. I thought about trying out the "Append" feature of the Save Records as PDF but am concerned that if our customer saw more than one copy of the document in the PDF files, they wouldn't understand the multiple copies.
February 21, 200817 yr Well you should be able to test if a file exists at a path with a simple command line script I would assume.... or you can check out this free plugin... http://mooplug.com/features
February 22, 200817 yr Author I am not certain how to script the file check other than to insert the file into a container field and then do an Insert Calculated Result for the container using a calculation of GetasText (ContainerName). Of course, this still puts me in the problem of the prompt specifying Insert File window when the file doesn't exist.
February 22, 200817 yr Author The MooPlug works really well. I just can't believe that there isn't something from within FileMaker directly to handle it.
February 22, 200817 yr Yes, many of us feel that FileMaker has been very (too) slow to add "file manipulation" to the product. Now that we have script Variables allowing us to use file paths in various operations it simply cries out for this functionality. Yes, plug-ins can supply it, and some of them are free or inexpensive, and some of them are cross-platform. But really, it's almost as if FileMaker has been trying to stick its head in the sand, IMHO. David McKee, who is (or was) a FileMaker employee, released an excellent free plug-in, File Toolbox, to do this years ago, with a large range of features. FileMaker released its Example plug-in, now defunct, its name conveying how little effort expended. I'm not really angry about it, I've learned (had to) many other techniques to do these things. But really, it's time to get with the times.
February 23, 200817 yr I am assisting a company who has a customer also demanding access to certain items. I set up a method for them by which the customer can access information to fulfill their needs without be able to search thru the server. Personally I would not want to be controlled to that degree by a customer. You welcome to contact me directly. I have some additional questions for you. Edited February 23, 200817 yr by Guest
Create an account or sign in to comment