Why is Applescript 20 times slower in Filemaker?

I have an Applescript that takes about a second to run in the Script Editor but when pasted into a single “Perform Applescript” FM script step, takes over 20 seconds. Why is this?

Maybe this will help.

https://community.filemaker.com/thread/153803

As you can see by the posts en usernames LouK already asked the question on FileMaker and looking at the responses he didn’t get the answer he was looking for :slight_smile:

LouK,

The problem is that there are too many situations why FM can be slower. However on the FileMaker community it’s unclear what the code is you’re dealing with. It can be an FM issues but could also be that you’re targeting your code wrong which means the AppleEvents will be bounced and re-routed which takes time. I understand that you cannot post the original code but can you at least simulate the situation with similar code when it’s running slower.

It has been determined that the scripts set up by LouK interrogate iTunes.

It is my experience that FileMaker + applescript, when used and adapted for this purpose, is 3X faster than Script Editor.