Jump to content

Imagewin for pictures


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

Recommended Posts

I have always developed with FileMaker for windows. I have bought myself a MacBook Air and love it. So now I am using FileMaker 16 Pro advance for MAC. I know that MAC does not label their directories like windows does. So I am having problems figuring out to get the right coding to access my photos. I have a folder called "Photos" that reside on the C: drive in windows. Then I reference that folder so pictures will populate automatically when I put in a record. Here is what I have on the windows fileMaker:

ImagePath:

Let 
(
[

// Transform the contents of a container field named Images to text
ImageRef = GetAsText ( ImagePath); Photos = Position ( ImageRef; "/"; 1;
PatternCount (  ImageRef; "/"))
];

Middle ( ImageRef; Photos + 1;
Length ( ImageRef ) - Photos )
)

images:

"imagewin:/C:/Photos/" & Film::title & ".jpg"

Then I go into Import folder and point to the folder all the photos are in. The problem I have now is how to point to that folder in "imagewin", is their an alternative called imagemac, then I could put in Macintosh HD/Users/patricks/Documents.  The folder is in the Document folder, called Photos. Thank you for any help.

Link to comment
Share on other sites

I don't really understand your question. If you have a folder named Photos in your Documents folder, then the path to it can be calculated using the Get (DocumentsPath) function.

For example, if the title of your image is stored in the Film::title field, then the path to the image could be calculated as =

"imagemac:" & Get (DocumentsPath) & "Photos/" &  Film::title & ".jpg"
Edited by comment
Link to comment
Share on other sites

  • 1 month later...

I am sorry that it took so long to answer. I had thought I sent a thank you, but does not look like it, sorry. I am still not getting the this to work. Should I be changing something in the ImagePath calculation? I have the Photo folder in the document directory. Thank you. 

Link to comment
Share on other sites

I am afraid I still don't understand what you're asking. Do you have a field that contains the image's file name? When you import a folder, you get the option to map the file name into a text field - so you shouldn't have to extract it from the container field. 

If you do extract it, then AFAICS your method will extract the file name including the extension - so you shouldn't be appending the ".jpg" part at the end. 

You should test the results you get at every step and see if they make sense. Also try my suggestion with a known file name.

---
Note that the ImagePath calculation you posted references a container (?) field named ImagePath; that too is confusing.

Link to comment
Share on other sites

For this kind of cross-platform problems I always use global variables setting script to change the paths with platform change which I think is easier rather than using complex calculations , set default globals with respective device id script and enjoy fm flow :) , since 9 yrs i never used global variables when i understood what are they my solution took Uturn IN UX/UI DESIGN hope u got my point try to use globals for ur paths :)

Edited by Dr.Gopala krishnam raju AMBATI
Link to comment
Share on other sites

  • 1 month later...

Instead of enter the path in the auto-enter calculation of the container, it needs to go in the Options > Storage (look to the bottom of that Storage tab). 

I think I misinterpreted your question.  Sorry. And no way to delete my own post. 😱

Edited by LaRetta
Link to comment
Share on other sites

If you define the field as auto-entered calculation, it will not update when you open the file on another computer. It needs to be an unstored calculation field. 

 

40 minutes ago, LaRetta said:

Options > Storage (look to the bottom of that Storage tab). 

That's an interesting alternative. But then I think the container field must store the image name and extension?

Link to comment
Share on other sites

Still not sure why it is not working. I can get it to work on Windows 10. But I am trying to stay with my MAC, since I really like it. So I should not be putting the 

"imagemac:" & Get (DocumentsPath) & "Photos/" &  Film::title & ".jpg"

in the Auto enter calculation? So how do I run it? I have 715 pictures right now so I would really like to be able to get them to auto fill. I already have the database built with all the information of each film, just need the container to fill the image that is related to that particular movie. The posters are stored in a directory called "Photos" in the Documents folder. Each movie poster is titled with a .jpg extension. Thank you. 

Link to comment
Share on other sites

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