Open a page in the user's default OS X browser

I’ve created a trivial AppleScript in FileMaker Pro 7 to open a page in a browser. I can’t use FileMaker’s built-in “Open URL” feature because it erroneously down-cases the URL.

It’s easy to send the URL to a specific browser:
tell application “OmniWeb” to open location “http://macscripter.net
However, I’d really like to send the URL to the user’s default browser. I’ve found examples in this forum of using Finder:
tell application “Finder” to open location “http://macscripter.net
Unfortunately, I get an AppleScript error when I try this on Panther:
“Finder got an error: Some data was the wrong type.”
I’ve also found baroque techniques for determining the name of the default browser.

I’m hoping to find something more straightforward.

– Ward

open location "http://macscripter.net"

This is good enough. “open location” is part of the standard additions.
However, as FileMaker includes a “GURLGURL” event itself (=“open location”), you can use a third-party app (not the Finder, which will error):

tell app "loginwindow" to open location "http://macscripter.net"

Thanks for the pointer to a compatible intermediate application (since Finder no longer works).

I had already found that “Script Editor” worked. Since I’m building my FileMaker database for a variety of users, I wanted to find an application that would be present on all OS X 10.2 and 10.3 systems.

– Ward

I think System Events is the preferred app for this type of thing:

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]