TaiChi56 Posted December 23, 2018 Posted December 23, 2018 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.
comment Posted December 23, 2018 Posted December 23, 2018 (edited) 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 December 23, 2018 by comment
TaiChi56 Posted February 10, 2019 Author Posted February 10, 2019 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.
comment Posted February 10, 2019 Posted February 10, 2019 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.
Dr.Gopala krishnam raju AMBATI Posted February 16, 2019 Posted February 16, 2019 (edited) 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 February 16, 2019 by Dr.Gopala krishnam raju AMBATI
TaiChi56 Posted March 24, 2019 Author Posted March 24, 2019 Still not getting this to work. I uploaded a small example of the database. I have the pictures in a folder called Photos and it is in the Documents folder. I cannot seem to get it to show the pictures. Thank you for looking at it. ClassicMovies_DB upload.fmp12
LaRetta Posted March 24, 2019 Posted March 24, 2019 (edited) 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 March 24, 2019 by LaRetta
comment Posted March 24, 2019 Posted March 24, 2019 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?
TaiChi56 Posted March 24, 2019 Author Posted March 24, 2019 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.
comment Posted March 24, 2019 Posted March 24, 2019 You should use the same formula - but the field type should be Calculation, not Container. Set the calculation result type to Container, and select 'Do not store ... ' in Storage Options.
TaiChi56 Posted March 25, 2019 Author Posted March 25, 2019 AMAZING, AMAZING, AMAZING. It worked, thank you for your help. LaRetta, thank you also. Both of you have a great day. Love this forum. 🙂
Recommended Posts
This topic is 2336 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 accountSign in
Already have an account? Sign in here.
Sign In Now