Applescript to switch default web browser

Several websites I use are only supported by either Firefox or Explorer, but I use Safari 90% of the time. I have scripted links to these other sites.

Is there an Applescript command which changes the default web browser, so I could flip it to Firefox at the beginning of the script, and then flip it back to Safari at the end of the script?

Can I ask why you want to change the default? I have several scripts that use Safari even though my default is Camino. I just tell Safari to do it in my script.

I appreciate your responses Adam. My original thinking was this. I was using Filemaker to initiate the script, and there is an “Open URL” command in Filemaker that uses the default browser, hence the idea to temporarily change the default browser.

After reading your post here:

http://bbs.applescript.net/viewtopic.php?id=16174

I actually ended up using the “Perform Applescript” command in FM to tell the browser directly to open the URL, rather than change the default using the following script. Works like a charm!


tell application "FileMaker Pro"
	set MyURLHolder to cellValue of cell "MyURLCalc" of current record
end tell

tell application "Firefox"
       activate
       Get URL MyURLHolder
end tell

Hopefully its useful for any future readers. The result is being able to dynamically generate a URL request from my dataset in Filemaker, and open it in Firefox.

Thank you again for tolerating a noobie.

A few days back I posted a question on creating a multiple page PDF from a scanned in multi-page document. Any advice on it would be great, I’ve tried other apps galore, no solution yet.