Koen Posted June 19, 2011 Posted June 19, 2011 Hello, It has been a long while since I posted on this forum. Must have been when was playing with filmmaker 5 or something. But now I have upgraded my filemaker 5 to version 11 advanced and fully busy creating a nice database. Yesterday I tried to creat a script that would automatically create several PDF files from my database. To do this I created a field 'pdffilename' and a script with a loop (that starts at the first record and exits the loop after the last record) and in between the script command 'export as PDF' And in the PDF script I set a file value as '$pdffilename' so it would create a PDF file wih the filename of the contence of the the 'pdffilename' field (which is : file:file01.pdf) the 01 will increase by the number of the record. So record no. 1 is 01 and record 2 is 02 etc. But somehow it does not work. When I start the script I get aan error message that the PDF file can not be created with a filename like this. When I change the '$pdffilename' for 'file:file01.pdf' it works fine (well it ovewrites the PDF file a lot of times, but the filename is accepted.) Any hint why my field entry does not work? Cheers Koen
Vaughan Posted June 19, 2011 Posted June 19, 2011 A couple of things that could be the trouble: is the pdffilename field calculating the correct file name? If it uses the Get( RecordNumber ) function then it needs to be unstored. Secondly, as the script runs and saves the pdf files, it is going to the next record so that the file name changes?
Koen Posted June 19, 2011 Author Posted June 19, 2011 The filename in the field from 'pdffilename' is 'file:leerling.pdf' This should be a correct filename. The error message I get can be seen in the attachment. It seems that FileMaker does not recognize the $ in front of the field name as a field but it thinks the filename is '$pdffilename' itself. strange isn't it? Cheers Koen
comment Posted June 19, 2011 Posted June 19, 2011 I set a file value as '$pdffilename' so it would create a PDF file wih the filename of the contence of the the 'pdffilename' field Not sure what exactly you did here - sounds like you did not define a variable. See if this helps: http://fmforums.com/forum/topic/45545-looping-script-to-extract-container-jpegs/page__p__212714#entry212714
Koen Posted June 20, 2011 Author Posted June 20, 2011 Not sure what exactly you did here - sounds like you did not define a variable. See if this helps: http://fmforums.com/forum/topic/45545-looping-script-to-extract-container-jpegs/page__p__212714#entry212714 Ah, that did the trick! I didn't know I it was a variable, thought that this variable was a field in some way. Thanks a lot!! Can I use these variable for other things, like a counter? So if I make a loop in a script and use a variable as counter and exit the loop if the variable reaches 10. (increasing the variable with one each time the loop starts over)? Cheers Koen
comment Posted June 20, 2011 Posted June 20, 2011 Can I use these variable for other things, like a counter? Yes.
Recommended Posts
This topic is 4907 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