Jump to content

Images, etc. in Container fields


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

Recommended Posts

I just managed to get something to work, which may be useful to someone, somewhere, someday :-)

Which is that the paths to files which show (or are otherwise referenced) in container fields behave much like html filepaths. You can not only go "down" from your current location, you can also go "up," by using the standard "../" (up 1 folder, directory).

You cannot, however, just use a full filepath. FileMaker is using "relative" paths to the files, from the current document.

I wanted to see if I could show images that were in an entirely different place on the hard drive. So I used a calculation with Get (FilePath) to count the level down to where I was, to get the "root" (Macintosh_HD in my case), adding an appropriate number of "../" (the filepath - 2), then added the rest of the file path (without the root). And it worked (eventually).

The path ends up looking like:

image:../../../../../../../../Users/fej/Documents/FileMaker/My_FM/aSmall_files/Pictures/Picturess7/images/Wounded_man.jpg

All it means is that you don't have to put the pictures "below" the FileMaker file.

One little "gotcha" I noticed in 7 is that Get (FileName) chops off the ".fp7" extension, but Get (FilePath) doesn't. Inconsistent. I guess it "looks better" without. It's fine, but I hope they don't change it back later, after we add ".fp7" where needed to our calculations.

Version: v7.x

Platform: Mac OS X Panther

Link to comment
Share on other sites

I don't think that they will change that, as the Get (FileName) is specified for just the name of the file itself. The filepath is much less restrictive.

I wonder though, since the Get (FilePath) is there, what would be a better use for the Get (FileName)?

Version: Developer v7

Platform: Windows XP

Link to comment
Share on other sites

Well, one use it is not good for anymore is to remove the file name from the file path, to give you the folder (directory) the file is in, often done for AppleScripts. In 6 I could be certain that there was only 1 "Pictures.fp5" in the file path. "Pictures" however is in there several times.

So from now one we'll have specifically remove the file from the filepath, the last entry. It's no big deal.

It is somewhat inconsistent for two very similar functions to return data differently. I guess they did so to remove the extension from the visible name of the window.

I'm happy to report that in the Design functions, Get (FileName) works as the file name (duh).

Link to comment
Share on other sites

This topic is 6509 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

×
×
  • Create New...

Important Information

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