Jump to content

Container Fields


 Share

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

Recommended Posts

I have a container filed where I store images (referenced) that are located in a folder within the folder that contains the FMP DB. How do I store these images in the container field with a relative path so I can move the main DB folder without disturbing the paths. Right now, if I move the main folder around I loose the referenced connection.

Link to comment
Share on other sites

I just noticed that if I import a folder or file it comes in with an absolute path but if I right click the container filed and insert a file it come in with a relative path.

Strange...is there a way to do an import an have relative paths? There are just too many records to do one by one.

Link to comment
Share on other sites

Well you didn't say that, and if you wanted you could just have a file name field and tack it on to the prefix e.g. "image:yourFolderName/" & table::fileName

Anyway, i don't see why you can't just import the folder? It would have to be done via the import script step though.

Link to comment
Share on other sites

The import script step yelds the same results as selecting import from the File menu. I thought about the calc thing but again there are just too many files sometimes to enter file names in one by one.

Edited by Guest
Link to comment
Share on other sites

You could import a folder of pictures, and only import the file name and path to text fields (in other words, you don't have to import the picture itself). You can then use a calculation based on that file path to show the pictures. Then, if you move the folder, you could do a Replace to modify the part of the text field that changed. Or you could import the file name, and calculate the entire enclosing folder path.

Link to comment
Share on other sites

Thanks for the reply! This sounds like a doable solution and I have been thinking about how to impliment it but I have not been successful creating the calc. I have not been able to find a text function that gives me the right flexability. Since I don't know exactally where the user will save these images or at least how many folders deep it will be, how can I pull out the part of the file path that I need? I tried using "MiddleWords" and it only seems to count to the left.

Link to comment
Share on other sites

When I import the image path the field displays the following:

"file://Macintosh HD/Users/greg/Datafiles/Dbase/Showbook v1/Templates/Rosco Templates/33001sm.jpg"

So you see it shows the absolute path. I would need to extract the text the falls after the word "Templates" and then do another calc to turn that into a relative path. I can only tell the user to save their images in this "templates" folder but they need the flexability to create additional folders within to keep everything organized. So I will never be able to predict how may folders deep they will go and therefore how much text there will be to extract.

Link to comment
Share on other sites

Extracts everything after the word templates

Let( path = "file://Macintosh HD/Users/greg/Datafiles/D base/Showbook v1/Templates/Rosco Templates/33001sm.jpg" ;

Right( path ; Length( path ) - Position( path ; "/templates/" ; 1 ; PatternCount( path ; "/templates/" ) ) - Length("templates") )

)

Returns: /Rosco Templates/33001sm.jpg

Link to comment
Share on other sites

This topic is 5693 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.