May 23, 201411 yr I am running Filemaker 11 pro advanced and I am using the latest version of Scriptmaster. When I enter the path to the file I want to load into the container field (It is a PDF file) I get the following error: groovy.lang.MissingPropertyException: No such property: pathToFile for class: Script1 Parameters: {J:Invoices1265.pdf=null} ---Script--- Script: File f = new File( pathToFile ); fileExists = f.exists(); return f; I also tried using "/" in the path and still get the error. I also tried "filewin:/J:/Invoices/1265.pdf" and still get errors. Can anyone offer any suggestions as to how I might address this problem.
May 23, 201411 yr   are you doing this with the Scripmaster demo file first?  pathToFile is a variable that the script is expecting. the error message would seem to indicate you have not yet set up the function correctly  If you don't want to pass this as a parameter you have to populate then variable first AND the variable pathToFile needs to be an OS path not a FileMaker version of it....  something like /Users/user/Documents/a.pdf C:Documents and settingsUsersuserDocumentsa.pdf   so to hard code this  pathToFile = 'thePathToTheFile' f = new File( pathToFile )return f.exists()   my version is in the screenshot to show you how it might work.... and as you can see is even more Groovy.. and as Groovy explicitly returns the last result you don't actually even need the 'return'
May 23, 201411 yr Author Thanks so much for the reply. I tried again and I still get the same error. See my screen shot.
May 23, 201411 yr thanks.. easy to fix where you have the path should be the NAME of your variable pathTofile and the path should be in the portal field exactly BELOW where it is now... john
May 24, 201411 yr Author Embarrasing. Yes you are right. It works but the container field returns an "unknown container object" error. My goal is to save a pdf file in a container field using a scipt action using a file path to the target field.
May 24, 201411 yr   then there is a bit more you are not telling us.... as you can see a PDF is in the container field from this screenshot  is this failing here or in a script where you are then using the function? if so can you post a screenshot of the script if not screenshot of the demo file
May 24, 201411 yr Author John, I truly want to thank you for all your kind support. It is obvious that I was not articulating clearly what I was trying to accomplish. I have an invoice app in Filemaker 11 that I was using to send invoices as email attachments (saving trees). I would save the pdf in a container field to use as a visual reference after sending the invoice. I was doing this manually using the insert object function and wanted to automate the process. I learned that Filemaker 12 has an insert pdf function so I upgraded to 12. You can see the end result in the screenshot. Like you I love using Filemaker for developing solutions. Meeting fellow users like you is another great reason for using Filemaker. Once again thanks for your help.
Create an account or sign in to comment