This is the simple script I use to import PDF files from a folder. First a list is created of all of the files in the folder using import folder, creating a global list from the records and then deleting all the records.
# Globals:FileList contains the list of files
Set Variable [ $FMLoc ; Value: "image:MyImagefolder/" ]
Set Variable [ $n ; Value: 1 ]
Set Variable [ $FileName ; Value: GetValue ( Globals::FileList; $n ) ]
If [ Right ( $FileName ; 4 ) = ".pdf" ]
Go to Field [ Select/perform ; PDF Test::PDF Container ]
Set Variable [ $FilePath ; Value: $FMLoc & $FileName ]
Set Field [ PDF Test::File Name ; $FileName ]
Insert PDF [ “$FilePath” ]
Refresh Window [ Flush cached join results ; Flush cached external data ]
Set Variable [ $n ; Value: $n + 1 ]
There are some 300 files in this folder of which 100 are PDF files. The script works well and fast EXCEPT when complete you cannot see any of the PDF image in a Container set for PDF. I am on a Mac Pro, using Filemaker 14.06 and have Preview set for the interactive part of the container. The only way to see the PDF files is to quit Filemaker and then restart. I have tried with and without a 3second delay and with and without the Refresh Window.
This file stores PDF files externally to a folder in the same folder as the file.
This seems to be a problem/bug with PDF containers on a Mac with at least FM14. Move back and forth in a set of records for a while and then the display of the container goes blank.