I have a script to move image files from one folder to another and create a new record in Filemaker 7.0 to display this image. The script works great except that I can never move all the files in one run. it ussually just stops at 43 files? I can run the script again and get another 43 files until I have under 43 files in the original folder, then the script stops after what seems to be an arbitrary number of files. I generally need to move and import about 200 images and it’s taking me 10 runs of the script to make it happen? Any help would be great as I’d like to make this an automated nightly script.
set importFolder to "Reprint Archive:Approved_Print:Transferred:"
set destinationFolder to "Reprint Archive:Reprint Archive_Print:"
repeat with i from 1 to count importFolder
tell application "Finder"
set ImportFile to (name of file i of folder importFolder)
duplicate file (importFolder & ImportFile) to folder destinationFolder
tell application "FileMaker Pro"
set Reprint to "Reprint Archive_S.fp7"
create record at end of database Reprint
set cell "cf_AdImage" of last record of database Reprint to file (destinationFolder & ImportFile)
set cell "s_ImportStatus" of last record of database Reprint to "NewArchive"
end tell
delete file (importFolder & ImportFile)
end tell
end repeat