Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted

I've been using/programming with Filemaker for a while, but I need help on how to do something.

I want to fill a container field in a record with a picture. Normally, I would do this with the "Insert/Picture" menu item and have it stored as a reference. Each container's reference could be from anywhere on my hard drive - not necessarily a single folder. However, the picture will never move once referenced.

Once this picture is referenced by my database, I want to have its absolute path as text. I can then use this text to attach an original file to emails, etc.

What type of script/function/etc. can do this? I only see Filemaker solutions for this by importing an entire folder's contents at once - not by inserting a single photo.

Help!

Thanks.

Posted

Grabbing the path out of a Container field is actually quite easy. All you have to do is create a calculation with a text result and it will display the path. You could create the calculation in a script as well.

To create an email, try this script:

Set Variable [$Path; Value:MYTABLE::ContainerField]

Send Mail ["$Path"]

$Path is used in the attachment portion of the Send Mail script step.

Posted

You can script your Insert Picture. There is a script step. So you need to go Go to Field [yourfield] and then Insert Picture [].

You can extract the path if stored as a reference by using:

GetValue ( GetAsText ( test ); 3 )

  • Newbies
Posted

Thanks for the input from both of you. I've tried these, and neither will give me the full path. Both will return only the filename.

Actually, the GetValue ( GetAsText ( test ); 3 ) will not return anything. Changing the last value to 1 will then return the filename.

I need something that would return something like this:

Drive:Folder:Folder:picture.jpg

If it matters, I'm using Filemaker Pro 8.5v1 and its on a Mac, System 10.4.9.

Posted

Both will return only the filename.

That will happen if you insert the actual picture into the container, instead of selecting 'Store only a reference to the file'.

Posted

rcscalebuilder:

Could you please post exactly how you got this calculation to work? I tried it as mentioned above (the GetAsText function) but, depending on the type of file in the container, it seems to return different information such as the filename or the file size.

Posted

For me, when I use this function, if I insert a file called "document.doc" into the container, then only the filename "document.doc" is displayed in my External Path field, which is calculated using GetValue(GetAsText(container);1).

If I insert only a reference to the file, the output of the GetValue function changes to "file:document.doc". It doesn't actually display the full path.

Any idea why? Ideally what I would like is the output to be "Driveletter:Folderdocument.doc".

Posted

Hi Mike,

This may seem like a dumb response,

It doesn't actually display the full path.

Any idea why? Ideally what I would like is the output to be "Driveletter:Folderdocument.doc".

How big is your field? If you click into it, does the whole path show up?

Lee

Posted

Hi Lee

Right after I posted I figured out my problem. The text output from the container field is two values: the filename first, followed by the full path. You have to expand the field in order to see the whole thing.

I used the following calculation to grab the path name and report it:

=Replace(GetValue(container;2); 1; 9; "")

Explanation for others reading this:

The GetValue function pulls the full driveletter/path/filename information for the file in the container field called "container". Since the full path information is the second value returned by GetValue, the parameter 2 is specified. The path is returned in the format: "winfile:/C:/Folder/Filename.doc". (If you're on a Mac, I think it returns "macfile:/.....".)

Since I didn't want to display paths with "winfile:/" at the beginning, I nested the GetValue function in a Replace function that replaces the first nine characters of the returned path ("winfile:/") with nothing ("").

Works like a charm. Note that you MUST insert a reference to the file and NOT the actual file itself in the container for this to work.

This topic is 6388 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
×
×
  • Create New...

Important Information

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