decpro350 Posted May 23, 2014 Posted May 23, 2014 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.
john renfrew Posted May 23, 2014 Posted May 23, 2014   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'
decpro350 Posted May 23, 2014 Author Posted May 23, 2014 Thanks so much for the reply. I tried again and I still get the same error. See my screen shot.
john renfrew Posted May 23, 2014 Posted May 23, 2014 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
decpro350 Posted May 24, 2014 Author Posted May 24, 2014 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.
john renfrew Posted May 24, 2014 Posted May 24, 2014   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
decpro350 Posted May 24, 2014 Author Posted May 24, 2014 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.
Recommended Posts
This topic is 3848 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