![]() |
![]() |
|
Automated mass import of images in FileMaker Pro v4 and v5 FileMaker Pro (FMP) has no built-in feature of allowing automated mass import of images. With an Apple Macintosh one can use AppleScript or the solution presented at the bottom of this page, for Windows such a possibility was lacking until now. I solved this problem in the following manner:
Go to DOS and change the prompt to the directory where the images reside. No other files must be located there. Enter at the prompt: dir /b > [namelist.txt]where [namelist.txt] is the text file you want to be created. "/b" stands for "plain names and no more rubbish" Beware of the 8+3 file naming convention. The image filenames themselves may be longer than 8+3. The namelist.txt will look like image1.gif image2.gif image3.bmp etc.Ad 2: Import the list into your empty image file into a field "t_image_filename" (1 name per record). Create a global "t_path_to_image_files" and fill it with e.g. c:\my_images\ Create a calculation field "c_full_path" that concatenates the two fields into "c:\my_images\image1.gif" etc. Create a container field "o_image" Get the freeware keyboard macro program AutoIt at http://www.hiddensoft.com/AutoIt FMP 4 Create a text file called "paste-v4.aut" which looks EXACTLY like this (case matters in AutoIt!): WinWaitActive, Import Picture
Send, ^v {ENTER}
(The first line waits for the Window "Import Picture" to become active; the second line sends a Control-V (= paste) + Enter.)
Compile this file with Aut2Exe.exe (part of AutoIt) into paste-v4.exe (50 K) and place it in C:\Program Files\Claris Corp\FileMaker Pro 4.0 Write the import script in FMP 4: Go to Record/Request/Page [First]
Loop
Copy [Select, "c_full_path"]
Go to Field ["o_image"]
Send Message ["paste-v4.exe","aevt","odoc"]
Import Picture []
Go to Record/Request/Page [Exit after last, Next]
End Loop
FMP 5
Create a text file called "paste-v5.aut" which looks EXACTLY like this (case matters in AutoIt!): WinWaitActive, Insert Picture
Send, ^v {ENTER}
(The first line waits for the Window "Insert Picture" to become active; the second line sends a Control-V (= paste) + Enter.)
It has been reported that in some cases the following alternative macro should be used instead: WinWait, Insert Picture
WinActivate, Insert Picture
Send, ^v {ENTER}
Compile this file with Aut2Exe.exe (part of AutoIt) into paste-v5.exe ((50 K; for the alternative choose paste-v5a.exe) (50 K) and place it inC:\Program Files\FileMaker\FileMaker Pro 5 Write the import script in FMP 5: Go to Record/Request/Page [First]
Loop
Copy [Select, "c_full_path"]
Go to Field ["o_image"]
Send Message ["paste-v5.exe","aevt","odoc"]
Insert Picture []
Go to Record/Request/Page [Exit after last, Next]
End Loop
(or ... Send Message ['paste-v5a.exe","aevt","odoc"] in case you use the alternative)
You probably could even make references to the images instead of loading them into FMP by using the mouse control options in AutoIt and having AutoIt check the reference checkbox. I have not tried that yet, the experimenting is up to you. The setting of the checkbox would have to be done between the first and the second line of the "paste-v4.aut" (paste-v5.aut respectively) file. The pixelwise location of the checkbox will depend on your screen size. But luckily AutoIt has a feature to show mouse coordinates. Be careful by the way with compressed JPGs - (at least) FMP 4/Win does NOT import them! For Mac-ish people here is a quote from a contribution by Bridget Eley to the comp.databases.filemaker News Group: > Here is a low tech, semi-automated method that works on the Mac platform. In the Finder, place all the image files in a single folder, set the View to List, click on the Name column to sort by filename, select all the image files, copy and paste into a text editor, then save the file to the desktop - this will produce a return separated list of filenames that can be imported into FileMaker. If you do this first, the import will create a new record for each filename which you can then use to guide the importing of the images into the container field. > Good luck! Back to the list of my FileMaker Pro trouvailles |
![]() |
![]() |
|