open URL to email message in apple mail from filemaker

I have connected all my gmail email accounts to apple mail. I want to create a link between a specific email message inside filemaker so that when I click on the link in FM it will open the email message. I do not particularly care wether it opens the email in the apple mail app or in safari or inside FM. I know how to retrieve the message ID of the email in apple mail. I tried placing the message ID path preceded by the prefix "message://" inside a field in FM. Then I call the script OPEN URL with the field contents as a parameter. The script activates my email app ( Apple Mail ) but does not go to the specified message. Instead it just displays the last viewed email in Apple Mail. I tested the same URL path in a safari window , it seems to work fine. What am I doing wrong pls ?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Will LovingPresident, Dedication Technologies, Inc.Commented:
I assume that when you use the URL in Safari, it's displaying the email within Safari. If thats the case, try this:

Create a layout in FileMaker with a WebViewer object and set the contents to a variable like $$EmailURL. Then in your script set the variable to the URL.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FileMaker Pro

From novice to tech pro — start learning today.