Error running Applescript from Filemaker

I have a native applescript which I run from within a Filemaker (Version 7) database that when activated gets a value from a cell within a record then activates the finder and creates a new folder at the root of the HD with a unique name that begins with the value from the record concatenated with the current date stamp as a string then followed with a default text string.

The script does work in that it creates the folder with the proper name but, unfortunately, it hangs in Filemaker with the Spinning Beach Ball until I hit “Command .” to escape out. I then get a “User Cancelled” error followed by a “Unknown Error: -128.” and I am returned to Filemaker without further problems. I guess I could live with the inconvenience of the error messages since the script ultimately does do what I need it to do but obviously I would prefer it work as intended.

What’s strange is that if I run the same script from the Applescript Editor it works perfectly fine.

I made a modification to the script to see if it was just a matter of activating Filemaker back at the end of the script and got a completely new error message after the Beach Ball: “Finder got an error: User canceled out of wait loop for reply or receipt.” followed by “Unknown error -1711”.

Since my script has no wait loop I am totally confused.

Anyone have any insights as to what’s going on with my script and how to fix it? Appreciate any and all help. Thanks.

-Kevlar

--This gets unique serial number from Filemaker database customer record
tell application "Finder"
	activate
end tell

tell application "FileMaker Pro"
	activate
	set myCell to cell "Receipt_Number" of current record
end tell
--This creates folder at root of HD with serial number as folder name prefix and current date as suffix
tell application "Finder"
	activate
	set D to current date
	set myShortDate to short date string of D as string
	make new folder at "Macintosh HD" with properties {name:myCell & "_" & myShortDate & "_" & "Photographs"}
end tell
tell application "FileMaker Pro"
	activate
end tell

Model: MacBook Pro 2.66 OSX10.6.4
AppleScript: 2.1.2
Browser: Safari 533.16
Operating System: Mac OS X (10.6)

Figured it out. It was a Filemaker script execution thing.
When telling Filemaker to run a script there’s a pull down menu with Script options “Halt, Exit, Resume, Pause”. The default is Pause and that’s what caused the Beach Ball. I changed it to “Resume” and it works flawlessly.
Thanks everyone.

-Kevlar