alphanitrate Posted December 13, 2007 Posted December 13, 2007 Can I write a script so that a container field would display a small .gif of an item that is out side of the FMP automatically? It would be based on the product SKU and would link to a folder that would have the item number (1234567.gif) I could do it in HTML but not to sure how to do it here. It could open in a pop up if that's any easier. Thanks for your help. I'm really new to all this.
_henry_ Posted December 13, 2007 Posted December 13, 2007 Hello Alphanitrate, I am not sure if I get you right. You can make a a field (type: Container). Then, in your database layout, you can put the container next to the Product SKU. Then whenever you add new record, you can insert directly the 1234567.gif to Container Field. the current record. It would display directly the image when you select the record...
Fenton Posted December 13, 2007 Posted December 13, 2007 (edited) If you're asking if you can display an image automatically using a FileMaker calculation, the answer is yes, if you can calculate the path to the image. It would need to be a FileMaker syntax image path. Example: imagemac:/Macintosh HD/Users/fej/Documents/Documents_ll/Others/Corrina/Corrina Pics/Img08.jpg If it was from a mounted drive you would need to put the name of the drive in the file path also. Look at the bottom of one of the file path dialogs, or look in FileMaker Help, for more on the syntax. This FileMaker calculation, with the above argument, would have a result of Container (not Text). Seems odd perhaps, but it works. Alternatively, if you have 8.5, you can use your web syntax path in a Web Viewer object. That is in some ways easier. Edited December 13, 2007 by Guest
alphanitrate Posted December 14, 2007 Author Posted December 14, 2007 so is it something like this? imagemac:/Macintosh HD/Users/fmp8/Documents/fmi/ how do i connect the SKU to this calculation? I've never really used a calculation before so it makes sense what you suggested but I do not know how to implement it.
alphanitrate Posted December 14, 2007 Author Posted December 14, 2007 thanks for your suggestion henry.
sbg2 Posted December 14, 2007 Posted December 14, 2007 What happens when the product packaging changes and a new picture is taken? The database would need to be updated as well. I think it would be better to only change the image in one place.
alphanitrate Posted December 14, 2007 Author Posted December 14, 2007 I'm working under the assumption that the new picture having the same file name would be referenced and then shown. If it is only a reference would it not change? The image change is what has prevented me from uploading images for the current 18,000 records. I figure if i manually insert them when i am done it will be about time to start over again. This is all new to me so any input from anyone who has gone down this path before would be great. Is it possible to import the images as a batch similar to importing a .csv file?
Fenton Posted December 15, 2007 Posted December 15, 2007 Yes, whatever image file is at the end of the file path is going to show. So it's a good way to deal with images that are being changed or modified. FileMaker doesn't have to be told about changes, it will show them automatically. You just create a calculation that produces the FileMaker syntax path to the image. It has a container result. How you build the calculation, from what parts, is pretty flexible (as most calculations are). The calculation would likely be a combination of text and values from a field (such as your SKU). But read on. As far as Importing them the first time, that's kind of a different question. The first question would be, "Do you really need to?" Because if you can calculate the full path, you don't need to import at all (unless you want to create and import a thumbnail). There are many ways to deal with images. It's important to choose the best method for your situation, because there are so many involved. But you haven't really given us enough information about what that is. The big question is, "Is your folder structure for these images consistent?" If either "Yes," or "I don't have the folder structure yet, but I want it to be consistent," then calculating the path is likely a good idea. As far as "I don't have the folders yet," that is a task for AppleScript, which can create the whole hierarchy of folders if you tell it what you need. Of course then you'd likely need to put the pictures into the folders manually, unless they are named in a way that AppleScript could tell where to put them.
alphanitrate Posted December 15, 2007 Author Posted December 15, 2007 BTW - Fenton you rock. 1. Do i need to import first time? Not if i can do this. 2. The location is consistent ie. Xserve>Advertising Drop box>internet. Now the images are currently in sub folders based on SKU's 01 011 012 013 02 etc. I was going to take these images and put them into one big folder so that it would be easier to locate. If the calculation can search sub folders then they could stay where they are. I tried that previous calculation attempt - but it kept throwing error messages.
Fenton Posted December 15, 2007 Posted December 15, 2007 If the folder structure is consistent AND known to the database, then the calculation method will work. To see what the path to any particular image file looks like, just Insert it, as reference. Create a calculation, GetAsText ( Container field ), result Text. Look at the path. This is what you need to produce with your calculation to show the image (which will have a result of Container). As you can see, these are kind of converse methods. How exactly you get the folder path depends on whether you can calculate it from fields in the FileMaker table. The images can stay in their subfolders. In fact, they likely would have to if there are duplicate file names. I don't know why you're getting "error messages". If you mean when you close the calculation, it's likely text quotes.
alphanitrate Posted December 17, 2007 Author Posted December 17, 2007 I'm checking it out as i write this, a few questions still. 1. How does the database know about the folder? Is inserting the initial image identify it? Here is the folder path: Xserve>Server data>Advertising Dropbox>Internet> Optimized Photos This takes you to the top level of the folders with the subs below. 2. Where do i create the calculation? in a separate field or in the container field? ( Here's the calculation i tried on the image container field IMAGE= "GetAsText ( IMAGE ), result Text" recieved error about expected operator. It also initially prompted that the result must be container. I'm really lost and would appreciate any help you could give. Thanks for all the help thus far!!
Fenton Posted December 18, 2007 Posted December 18, 2007 imagemac:/Xserve/Server data/Advertising Dropbox/Internet/Optimized Photos/001.jpg That will show an image at that path. How you put it together to get that is up to you, and your folder structure. The calculation result must be Container (how else could it show a picture in the field?). The GetAsText (Container) is the opposite kind of calculation; it would have a result of Text. It can be used to tell you what the path is to an image that has been Inserted. But you don't really need that, so ignore it for now.
alphanitrate Posted December 18, 2007 Author Posted December 18, 2007 Sorry fenton, i'm still not getting it. ( My fault, not yours.) I opened " define database", selected my container field "image", clicked on "options for the field image" and clicked on the calculated value to bring up the "specify calculation" window. I put in what you suggested, Imagemac:/Xserve/Server data/Advertising Dropbox/Internet/Optimize d Photos/001.jpg but i am getting a "specified field cannot be found" when i first tried it. I changed the imagemac: to my container field "image" with the same result. I think perhaps that my lack of knowlege with the calculations is holding us up. I've included a screen shot so you can see what i've done. If it would help and you have time, I could upload the file if it would help you see what I have done. Is Imagemac a container field name or a calculation function? I am operating under the assumption it is just a name. One other question - once these images are referenced - are they viewable by clients using the web viewer? Thank you again for all the time you are spending with me on this. Picture_5.pdf
Fenton Posted December 18, 2007 Posted December 18, 2007 (edited) Yeah, you're having trouble with understanding the syntax of things in a calculation dialog. If something is a field (or a variable) you can put its name in without quotes. And some of your path will be a field; the file name at the end. And likely part of the folder path. But anything which is just plain text must have quotes around it. The "image:/" (or "Image:") is the prefix FileMaker wants, but it is just text, so must be quoted. "imagemac:/Xserve/Server data/Advertising Dropbox/Internet/Optimized Photos/001.jpg" The above will work, if that's the correct path to that file (obviously you'd need a file named "001.jpg". But more likely you'd have field, FileName, which would have a different name for each record. Then the calculation would be: "imagemac:/Xserve/Server data/Advertising Dropbox/Internet/Optimized Photos/" & FileName Notice, quotes around text, not around field name, with an ampersand (&) to join them. If you have the images in a subfolder, and also have a SubFolder field in FileMaker, it would look like: "imagemac:/Xserve/Server data/Advertising Dropbox/Internet/Optimized Photos/" & SubFolder & "/" & FileName [P.S. Ignore spaces like "Optimize d". The PHP engine likes to put those in paths, for some reason.] Edited December 18, 2007 by Guest
_henry_ Posted December 19, 2007 Posted December 19, 2007 Hello Sbg2, Thank you for your input. For Alphanitrate, here is the good link to learn Filemaker: http://www.filemaker.com/nine/learning/ The first time I mentioned about the image, I got the idea from here: www.lynda.com/go/filemaker. There are some tutorials and videos that would be helpful as a starting point...
alphanitrate Posted December 19, 2007 Author Posted December 19, 2007 OK thanks to all the help - seems easier now. I'm going to go back to the Resources and the manual and read up a bunch more before i go on. I'll let you know how it turns out once I have a better understanding. Happy holidays to all. " Me fail english? that's unpossible!" - R. Wiggum thanks again for all your help.
Newbies clarislover Posted December 21, 2007 Newbies Posted December 21, 2007 Hello Fenton -- I have quite a similar problem and i really don't know how to solve it. i read this thread and it did help me a lot. but i was wondering how i could share files from a FMP server over the network. so here's my situation: the calculation i have in my database works just fine. the problem is every time i try to export the content of the field onto, say my desktop from a filemakert client on the network, the software tells me that the file could not be found, therefore the export cannot take place. what kind of script can i write that will allow me to download a file that's referenced in a database, and that's also residing on a folder on the fmp server hard drive. right now, i can download the file from teh server itself using teh client version of filemaker, but every time i try to do this from a network mac, the operation fails because the file cannot be found. i've attempted the follwing calculation with no success: "imagemac:/Macintosh HD/Users/John/Documents/Images/holiday.jpg" --> The picture shows up on a networked client but fails to be exported. is there anyway i can get this to work without using the web component of the filemaker pro server? Many thanks for all of your help. Yeah, you're having trouble with understanding the syntax of things in a calculation dialog. If something is a field (or a variable) you can put its name in without quotes. And some of your path will be a field; the file name at the end. And likely part of the folder path. But anything which is just plain text must have quotes around it. The "image:/" (or "Image:") is the prefix FileMaker wants, but it is just text, so must be quoted. "imagemac:/Xserve/Server data/Advertising Dropbox/Internet/Optimized Photos/001.jpg" The above will work, if that's the correct path to that file (obviously you'd need a file named "001.jpg". But more likely you'd have field, FileName, which would have a different name for each record. Then the calculation would be: "imagemac:/Xserve/Server data/Advertising Dropbox/Internet/Optimized Photos/" & FileName Notice, quotes around text, not around field name, with an ampersand (&) to join them. If you have the images in a subfolder, and also have a SubFolder field in FileMaker, it would look like: "imagemac:/Xserve/Server data/Advertising Dropbox/Internet/Optimized Photos/" & SubFolder & "/" & FileName [P.S. Ignore spaces like "Optimize d". The PHP engine likes to put those in paths, for some reason.]
Newbies Tim Design Posted January 18, 2008 Newbies Posted January 18, 2008 Hi - thanks so much for your help with this issue. I am trying to do what you describe in this post. I have created calculated file name that works, but it does not update per record. It calculates a file name once and does not change for each record like I need it to. Here is my calculation: "imagewin:/M:/mas90/Images/LCI/" & School Number & "-10.jpg" School Number is a field name which contains the only part of the filename that is different for every record. I have played with the storage options and no combination of the options has worked. It will not update the calculated filename as I scroll through records no matter what I do...it just shows the picture (or filename as text...cause that would be fine also) for the first record on every single record. Can you help? Thanks so much!!!
Barrettb Posted March 4, 2008 Posted March 4, 2008 I went in circles with this a while back and pretty much gave up on it for now - other fires to put out. http://fmforums.com/forum/showtopic.php?tid/190241/ If you are like me in your needs what you are asking for is not any more complicated than what we ask a basic html page to do in a browser - simply display the image found at the end of a "calculated" path with a preplanned name.jpg.....
Recommended Posts
This topic is 6109 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