How to reset application names in tell blocks?

I have two copies of Filemaker on my machine.The name “Filemaker” was linked to “Filemaker 7”, and “Filemaker 5.5” to the older program (.app renamed as 5.5) — Until recently where a script targeted at “Filemaker” ran the older version (who knows what I did to prompt that, but so be it! :wink:

So I just thought I would rename the application in scripts, and wrote a new tell block as – `tell application “Filemaker 7”.

This brings up the ‘choose an application’ dialog, I select Filemaker 7 (Filemaker.app), and it actually changes the tell block to “Filemaker 5.5”! A test run and it opens the older version!

So clever, it’s dumb!

So how can I reset the application-name associations in Script Editor?

Thanks for your knowledgeable assistance!
Cheers,
Juz

AppleScript doesn’t store application references by name, rather by application signature

In this case, both Filemaker 5.5 and Filemaker 7 have the same signature so the actual definition of which one AppleScript picks is, at best, undefined. AppleScript looks up the application that has the name you specify and stores its signature in the script when you compile. The next time the script runs it looks for an application with the same signature and hence the problem.

In some cases this is a good thing - if you install a new version of an app then your script will automatically target the new version rather than continue to look for the old (presumably uninstalled) copy. As you’ve found, though, it has its problems.

The simplest approach is to specify the application by path:

tell application "HD:Applications/Filemaker Pro 7.app"
...

which lets you target a specific version.

Brilliant - worked a treat.
Thanks.