Applescript causes spinning wait cursor (within Filemaker)

Hey there,

In one of my Filemaker solutions I offer the user to insert a file into a Filemaker record. Each of my users has his own folder from where he can choose the files that he wants to insert.

To make sure that every user can choose from his own folder, I attached an Applescript that gets called from a Filemaker script: Applescript opens the correct folder (based on the user’s name), tells Filemaker what file the user has chosen, and Filemaker does the rest. (This technique is based on Fenton’s work http://fmforums.com/forum/showtopic.php?tid/199641/.)

So far, everything works very well, with one exception: Every now and then, while the Applescript is being executed and the Choose File window is open, the spinning wait cursor appears, for no reason. I can still click and choose files, I can click OK or Cancel and so on; it is just that the cursor turns into the beloved spinning rainbow pizza. So, although everything works fine, this is something that causes a lot of confusion among the users (“Hey! The system has stopped responding!..”)

So, I wonder if and how I can get rid off this. It only happens with Applescript. Any ideas?

For those of you who are familiar with Filemaker, here is the Filemaker script step:

Run AppleScript [ Calculated AppleScript: “set Mac_path to (choose file without invisibles default location alias "Macintosh HD:Users:MJ:Documents:” & Get ( AccountName ) & “:") as Unicode text¶¶set field "AppleScriptPath" of current record to Mac_path” ]

In real Applescript this would result in something like this:

set Mac_path to (choose file default location alias "Macintosh HD:Users:MJ:Documents:JohnSmith" without invisibles) as Unicode text

set field ...

Thank you,
Mike

Model: Mac mini Intel Core 2 Duo 2 GHz
AppleScript: 2.1
Browser: Safari 531.9
Operating System: Mac OS X (10.6)

O.k., I still haven’t found the reason behind, but the following workaround helped, and it might help in case somebody faces the same problem… It seems to be mainly Filemaker related.

What seems to cause trouble is the Allow User Abort script step. The critical script steps are:

When the script runs these three steps in the above order, then it happens that the spinning wait cursor appears in case the user clicked OK in the custom dialog too long.

Changing the order helped (finally):

With this order no rainbow pizza appears!

Mike