Launching the correct version of FileMaker

I’m writing a script intended for FM7 on a machine with multiple versions of FileMaker installed - every version from 4 through to 7. The “tell filemaker pro” line seems to address the wrong version of FileMaker, because instead of FM7 doing what I tell it to do, FM4 launches and tried to run the script instead.

Does anyone know how I can reliable get FM7 to execute my scripts?

Many thanks,
Tom

This may work:

tell application "Finder" to ¬
	set fmp7 to application file id "FMP7" as text

tell application fmp7
	--> statements here...
end tell

If you need it, wrap the tell block into a “using terms from application…” statement.

Fantastic - I’ve found that this works just fine:

tell application “Finder” to set fmp7 to (application file id “FMP7”) as string
using terms from application “FileMaker Pro”
tell application fmp7
tell window 1
tell current record

		end tell
	end tell
end tell

end using terms from

Many thanks,
Tom