Importing to FileMaker
Importing to FileMaker
- Subject: Importing to FileMaker
- From: Dennis Jones <email@hidden>
- Date: Fri, 25 Mar 2005 09:51:48 -0800
I seem to have a timing problem with this code.
importToDB copies a series of files (5 to 10) from the sourceFolder to
the importFolder and renames the copy. Then it calls a script in
FileMaker to import the file just copied and process the file.
This script runs file for 3 or 4 interations, but about the 5th call
to the FileMaker script, the import.txt file in the importFolder
cannot be found by FileMaker and then AppleScript times out.
What can I do to ensure the file is available before calling the
FileMaker script?
--
Dennis Jones
email@hidden
-- code --
on importToDB(sourceFolder, importFile, importFolder, scriptToRun)
set the itemList to list folder sourceFolder without invisibles
set sourceFolder to sourceFolder as string
repeat with i from 1 to number of items in the itemList
set thisItem to item i of the itemList
set thisItem to (sourceFolder & thisItem) as alias
set thisInfo to info for thisItem
-- Set file name to currentName
set the currentName to the name of thisInfo
if folder of thisInfo is false and ¬
alias of thisInfo is false then
copyToImportFolder(sourceFolder, importFolder, importFile, currentName)
do shell script "sleep 1"
tell application "FileMaker Pro 6"
do script scriptToRun
end tell
end if
end repeat
end importToDB
on copyToImportFolder(sourceFolder, importFolder, importFileName,
sourceFileName)
tell application "Finder"
update folder importFolder
try
delete file importFileName of folder importFolder
end try
set importFile to (duplicate file sourceFileName of folder
sourceFolder to folder importFolder)
set importFile's name to importFileName
end tell
end copyToImportFolder
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden