8 Replies Latest reply on Jun 14, 2013 9:03 AM by philmodjunk

    Exporting multiple image containers

    CassidyZachary

      Title

      Exporting multiple image containers

      Post

           I built a database where each object record has a photograph. Is it possible to export multiple image containers from different object records at the same time? In Browse Mode, which is so similar to Excel, it seems like I should be able to select the entire "IMAGE" field and export at once. Help!

        • 1. Re: Exporting multiple image containers
          philmodjunk

               Just by picking from the menus, you can only export one image at a time.

               But a fairly simple script could use the same Export Field Contents action while looping through your records to export all or a group of image files from your table.

          • 2. Re: Exporting multiple image containers
            CassidyZachary

                 Thanks for your response. Is a "script" something I would have to write or could I find someone to write it for me? I have very, very basic skills when it comes to using Filemaker.

            • 3. Re: Exporting multiple image containers
              philmodjunk

                   we can post an example, but you'd have to put it into your database and modifiy the references to table occurrences and fields to make it work for you:

                   #Perform a find or do some other action to pull up a found set of the image files you want to export
                   Set Variable [$Folder ; value: "file:" & Get ( DesktiopPath ) ]--> this specifies your desktop, but you can specify any location in your computer here
                   Go to Record/Request/Page [First]
                   Loop
                      Set Variable [$Filename : value: //use calculation shown below modified to fit your table and field here ]
                      Set Variable [$Path ; Value: $Folder & $Path ]
                      Export Field Contents [YourTable::Field ; $Path ]
                      Go to Record/Request/Page [next ; exit after last]
                   End Loop

                   Use this calculation to assign a value to $Filename:

                   This should work for all insertion and storage methods except Insert Object (FileMaker 11/windows only):


                   Let ( [T = GetAsText ( GetValue ( YourTable::containerField ; ValueCount ( YourTable::containerField ) ) ) ;
                             L = Length ( T )];
                             Right ( T ; L - Position ( T ; "/" ; L ; -1 ) )
                       )
                    

              • 4. Re: Exporting multiple image containers
                CassidyZachary

                     Thank you so much! I will try this out.

                • 5. Re: Exporting multiple image containers
                  CassidyZachary

                       Again, thank you so much for your assistance with this. I appreciate your time and patience with me! I have finally found the time to attempt to implement this script into my database but I am really confused (I am a novice!). Do I need to define "$Folder" and "file"--if so, can you clarify what exactly these are supposed to be." I'm really confused what all of these terms are" "Yourtable" "Field" (the only one I think I get, which is the name of the container field correct?)

                       Also, you say to use a calculation to assign a value to $Filename but do I need to define "Yourtable"/"Containerfield" "Valuecount" etc. 

                       THANK YOU for any assistance in advance.

                        

                        

                  • 6. Re: Exporting multiple image containers
                    philmodjunk

                         Since I don't know the name of your tables and fields, I used YourTable::Field as a place holder for the reference to your container field. Replace it with a reference to your container field.

                         The rest of the script can be used exactly as I posted unless you want to export the fields to a different location than scattering them all over your desktop.

                         You may find this thread on $Path variables helpful: Exploring the use of a $Path Variable in Scripts

                    • 7. Re: Exporting multiple image containers
                      CassidyZachary

                           Thank you! Is the table what contains the field? I will check out the path tutorial now. THANK YOU. Do you have a reference I could use on how to actually "run" the script. This is very unclear, as well.

                            

                           best,

                           Cassidy

                      • 8. Re: Exporting multiple image containers
                        philmodjunk
                             

                                  Is the table what contains the field?

                             It's not clear to me what you mean by that. All fields are defined as part of a table. When you first create a database file, you start with a single table with the same name as your file, but you can add as many additional tables as needed for your solution to work. You'll find that as you set up these script steps, you can select the needed fields from lists of fields with either a single or double click and FileMaker will get the syntax right for you.

                             

                                  Do you have a reference I could use on how to actually "run" the script.

                             Scripts are created via Manage | Scripts.

                             Once created, scripts can be performed in one of four ways:

                               
                        1.           Select the script from the Scripts Menu if the check box in Manage | Scripts has been selected to make it visible in this menu.
                        2.      
                        3.           Open Manage | Scripts, click the script to select it and then click the button with the green arrow to perform it.
                        4.      
                        5.           Add a button to your layout and use Perform Script in the button set up dialog to select your script as the script to be performed when the button is clicked.
                        6.      
                        7.           Set up a script trigger to perform the script. (Look up Script Trigger in Help and any tutorial sources you have to learn more.)