Automatically set default browser and default home page

Hello,

I help out in a small computer lab of G4 macs running 10.3.9. I would like to have the default web browsers be set to Firefox and the default web pages be set to the internal lab’s website.

Is there a way to script this so these settings are locked in? The kids somehow change the default browsers and default web pages.

Thanks,
tweak

Hi Tweak;

I find the default browser this way:


try
	set defaultBrowser to (do shell script "defaults read com.apple.LaunchServices | grep 'http;' | cut -d \\\" -f 2")
on error -- if not listed, then the system default
	set defaultBrowser to "com.apple.safari"
end try
tell application "Finder" to set tBrowser to name of (application file id defaultBrowser)

You would have to set it using a defaults write to com.apple.LaunchServices to “org.mozilla.firefox”

Last time I looked, Firefox was not scriptable, so I don’t know how to set its default web page from a script (and I don’t use FF), and I think you’d have to GUI script its preferences to set the default page.

Thanks for the reply. I’ll try this out and report back.

I didn’t mention that it’s in ~/Library/Preferences (you can find several of these files but the one that counts is the user’s, and that the key is LSHandlerRoleAll to a string entry: “org.mozilla.firefox”

Good luck AppleScripting the Preferences Window - the buttons at the top don’t show up in UI Browser so if a student has not left the Preferences window at “Main” it will open somewhere else.

Secondly, FF is a ported Windows program with .ini files and all that, but no standard .plist file anywhere. They store stuff in a non-standard way, so you’ll have to change the opening page and see what changes when you save it.