1 Reply Latest reply on Jan 3, 2014 9:06 AM by philmodjunk

    Pictures

    cschul

      Title

      Pictures

      Post

           I'm trying to export pictures out of container fields. The pictures are stored External (Open). I have many different formats in the database. jpg, pct, png, tiff. How can I export the files with their proper file extensions? 

           This is just a sample of the script I'm using. I have about 7 pictures per catalog number. The pictures have to have the catalog number in the naming.

           Loop

               Set Variable [$image; Value:database::catalog number & "-1"]

               Export Field Contents [database::picture; "$image"]

               Go to Record/Request/Page [Next; Exit after last]

           End Loop

            

           Thanks for any help!!

        • 1. Re: Pictures
          philmodjunk

               It's possible to extract the original file name from the container field. You can use this file name or just the file extension.

               //This should work for all insertion and storage methods except Insert Object (Filemaker 11, WIndows only):
               Let ( [ T = If ( LeftWords ( YourTable::ContainerFIeld ; 1 ) = "remote" ; GetValue( YourTable::ContainerFIeld ; 1 ) ; GetValue ( YourTable::ContainerFIeld ; ValueCount ( YourTable::ContainerFIeld ) ) ) ;
                         L = Length ( T )];
                         If ( LeftWords ( T ; 1 ) = "remote" ;  Right ( T ; L - 7 ) ; Right ( T ; L - Position ( T ; "/" ; L ; -1 ) ) )
                   )

               for more about container fields, $path variables and the script steps that can use them: Exploring the use of a $Path Variable in Scripts