File Maker Pro UI Scripting

I’m trying to import a script from one DB into another in FMP12 and found no other way then using UI scripting. Most of the time the script stuck when I need to mark the checkbox, complaining that the UI element cannot be found, but as visible on the picture, it is referenced properly, at least this is how I see it:

Pls visit the link for the picture showing the problem, it is much clearer then if I write it down: [url=]The funny think is that sometimes the script works fine and I cannot figure out what is making it working fine sometimes.

Any idea what am I doing wrong, or if there is some other way to refer to that UI element?

Thanks Zsolt

If I understand well the problem (probably not), why script the importing of Scripts? Aren’t you better off importing data to a new database with all the scripts in place?

I did not want to go deep into the problem, but for the sake of clarity maybe I should. Thanks for asking.
I have a bunch of old FMP DBs which I have to export data from. To the best of my knowledge, there is no way I can make FMP export data using AppleScript as the FMP dictionary does not contain the export command.
However, I can start FMP scripts using AppleScript. So the idea is to use AS to start a FMP script which will do the job of exporting the data into external files, then I can use AS to do post processing.
But for this to work, the FMP script has to be contained in the file I need to process, and sadly, it is not.
So what I’m trying to achieve is have one DB contain the scripts I need and then import these scripts into the DB I need to process and then run them.

I hope this make the things clearer.

All the suggestions or questions are welcome, thanks.


I got an answer on stackoverflow, inserting a delay 1 before the failing line seems to solve the problem.