4 Replies Latest reply on Jan 25, 2010 2:12 PM by philmodjunk

    Opening a picture file



      Opening a picture file


      I have containers holding a picture file (reference) and a script to insert the file.  I cannot seem to open that picture in Preview though.  I double click the container and nothing happens, I wrote a script to Goto field and Select/Perform and again nothing happens.


      However if I insert a file (reference) it will open, but the only thing that shows in the container is the jpg icon.  Is it possible to open a picture file without exporting?  It seems odd that filemaker wouldn't allow a picture file to open, so I assume I am missing an option selection. 


      If filemaker can't perform this task for whatever reason, do I have to figure out a work around through scripting like inserting both a picture reference and file reference to the photo at the same time and then another script to open just the referenced file (of the photo)?  Any ideas of how that first script would have to be done to work seamlessly?



        • 1. Re: Opening a picture file

          I'm not an expert, and others will no doubt have better ideas than me, however, I wanted to relay what I have done.  If you definitely want the picture opened in Preview, then I'd wait for input from other people, but if you just want to be able to view the picture, what I have done is create another layout with a larger container field on it, and when you click on the picture icon, it runs a script that opens up that other layout and shows you the larger picture.  I've put icons on that layout with similar things to Preview icons, like zoom in and out, and have attached scripts to them so they work in a similar manner, and also an "export" button which allows the user to save the picture to their computer via an "export field contents" script step.  One possibility, although perhaps not what you're after.


          • 2. Re: Opening a picture file

            Which script step did you use to insert your picture? Insert Picture or Insert file? If you use the insert picture, with the store as reference option selected, it should be appear as desired in the container field.


            To open the referenced file, you'd use either Export field contents from the edit menu or write a script that uses the same action.

            • 3. Re: Opening a picture file


              I used the Insert Picture and checked off the reference option and it does appear perfectly in the container field.  However I would like to open this picture in Mac's Preview application without having to export the picture (Its already on the computer, don't want to keep making duplicates every time it is opened).  I know I can do this *if* I chose to insert a file, however then I don't get the picture in the container, only the icon. Is there a way to open a picture file without having to export and not using "insert file"?



              Thanks, I thought about that but at the time was against it because I couldn't zoom or anything... but you wrote about being able to zoom in and use other similar functions.  Its a second place to being able to open in Preview, but it is something I will have to look into. I would like to learn how to create a layout like that, as I am beginning to doubt that FM has the ability that I was looking for. 

              • 4. Re: Opening a picture file

                You can script the export so that the script deletes the exported file in most cases.


                Here's a link to where there's an example script posted by Fenton Jones that does the trick:




                You'll have to modify it a bit to refer to a jpeg or other graphic file type instead of a PDF, but the technique still works.


                You may also be able to use Open URL in a script to open the file.