8 Replies Latest reply on Jun 19, 2012 5:59 AM by LyndsayHowarth

    Exporting pasted images in a container field

    JavierDura

      I'm looking for an idea to a scripted export of field contents from a container field in FileMaker 11.

      I know how to handle this from regular imported field contents, but in this case, images, sounds and files were mostly inserted by copy-paste instead of the insert-image step.

      Thanks.

        • 1. Re: Exporting pasted images in a container field
          LyndsayHowarth

          Hi Javier,

           

          You can still export the images even though the images were pasted. You need to build a field that calculates an appropriate filename for them to use in the export that makes it possible to link them up with the record they came from so starting with the record ID or such in the filename is a good idea.

           

          If they were pasted in on a Mac, it is very likely that they were PICT files and would have an extension like ".pct". If they need to be used more generically then you might batch-process them once outside the database to convert them to JPG or GIF or such. Then your calculation on the import could look for the file name with the new extension. It would be a similar scenario for Windows pics but I'm not sure what extension it would create. Try exporting the file allowing FMP to name the file and see what extension it creates naturally.

           

          HTH

          - Lyndsay

          1 of 1 people found this helpful
          • 2. Re: Exporting pasted images in a container field
            JavierDura

            Dear Lyndsay,

             

            Thank you for your answer.

            The problem with this particular solution is that it contains confidential information and my customer has sent me a clone with only 5 records in order to develope the script.

            That script will be pasted later on the main .fp7 file that contains thousands of records.

            In other words, the script should be ready to find any kind of data inside the container fields.

             

            Anyway, I´ll try to do what you suggest.

            Thanks.

            • 3. Re: Exporting pasted images in a container field
              JavierDura

              Now I have the script running.

              It export files from the container fields as expected.

              The only problem comes from pasted images: I have to choose one extension for my exporting path (.pict or .jpg).

              I choosed ".jpg".

              As some of the pasted images are pict, when I export them they get the wrong extension and the file cannot be opened.

              On the other hand, jpeg files can be open without problems.

              Does anybody know if we can know in advanced (or with a calculation) if the image pasted into a container field is a pict or a jpeg?

               

              Thanks!

              • 4. Re: Exporting pasted images in a container field
                Stephen Huston

                You can control what file formats will be allowed into a container in FMP12, but I don't believe any FM11 function will allow this without a plugin.

                 

                If a wrongly-extensioned PICT file won't open with the JPG extension, users could be advised to try renaming it as a PICT or even add a button in FM that would export it as PICT manually if they find the JPG won't open.

                 

                In FMP12 there are also options that would allow the creation of a JPG for export using the new container calculation functions, but not in 11.

                1 of 1 people found this helpful
                • 5. Re: Exporting pasted images in a container field
                  JavierDura

                  Thank you for your comments, Stephen.

                  My customer is leaving FileMaker and he only wants to extract all the information that is included in his database. So, no upgrade to FM12 is possible.

                  This database is a complete disaster (useless fields, too many repeated scripts, etc.) and, on the other hand, it has confidential information so I have to make a script that will be copy/pasted from a clone of the database that I have (with only 5 records) to the real one (30.000 records).

                   

                  Anyway, I will let him know that if an exported image cannot be open, extension should be changed.

                  Thanks again, Stephen.

                  • 6. Re: Exporting pasted images in a container field
                    LyndsayHowarth

                    You can create a calculation which figures out the filename of the existing image... getastext(container) which will also tell you dimensions etc so you will have to parse it. It may not have an existing extension though if it was pasted....

                     

                    - Lyndsay

                    • 7. Re: Exporting pasted images in a container field
                      Stephen Huston

                      If the user does not need to continue using the FM11 system, but just wants the images out, then converting a copy of the file to 12 (even the trial version) just for that purpose -- to create consistent images and export them -- might be a quite sensible approach.

                      • 8. Re: Exporting pasted images in a container field
                        LyndsayHowarth

                        very true... It would make it a sank and you get 30 days...

                         

                        - Lyndsay

                         

                        Message was edited by: Lyndsay Howarth LOL... that was supposed to say "snack" not "sank"