1 Reply Latest reply on Mar 18, 2017 9:47 AM by philmodjunk

    Script to insert files on Dropbox into Container Field


      I've creating an database for my stamp collection. New records are periodically imported from an Excel file which includes the filename of the image file.

      Manually adding potentially thousand of image files (.jpeg's or .bmp's) to the container field isn't practical, so I need help writing a simple script. Other than occasionally defining an occasional simple calculated field or using text functions in Excel, I have no script writing experience.


      I did search the discussions to see if other users have asked similar questions, but I'm too much of a beginner to understand how to modify the example scripts properly.


      A bit more information:

      1. The script should only modify records that have empty container fields. I've created a calculated field that returns a value for container field length, so that I can find only those records where this attribute=0.
      2. The script should only modify records in a found set. (Images will only be available as I scan them)
      3. The container field "image" only stores a reference to the image file. The field "filename"
      4. The image files are stored in one of several Dropbox folders (named to correspond to country), so perhaps having an interactive filepath dialog box might be necessary.
      5. Currently I'm running FM Pro 14 on a Windows 7 machine, but will probably end up moving the database to a Mac running OSX 10.x.
      6. Will be testing everything on a copy of my database until it works


      One last thing... could someone recommend a FM book (or website) that has a good beginner scripting tutorial?


      Thank you,

      Felicia Lovelett

        • 1. Re: Script to insert files on Dropbox into Container Field

          Before diving into the details, take a look at selecting Import Records using the folder option. In a test table see if you can pull all the images from one folder into accontainer field in this table as "references " to the image files. Note that you can put the file name into a text field at the same time.


          Report back on your results and we can then discuss how to modify this practice task to do what you need.  If your image files have unique file names across all stamps in your collection, this will be easier to do.