Jump to content

Get File as Container file path error


This topic is 2629 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Link to comment
Share on other sites

post-100975-0-08066300-1400842861_thumb.

 

 

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'

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

post-100975-0-01423100-1400915414_thumb.

 

 

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

Link to comment
Share on other sites

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.

 

Screenshot-2.jpg

Link to comment
Share on other sites

This topic is 2629 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Who Viewed the Topic

    1 member has viewed this topic:
    Agentshevy 
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.