There have been some changes made in LaunchServices defaults on the upgrade from Jaguar to Tiger. On my system [10.4.4] this shell script returns the name of the default email client. Would someone running Jaguar tell me what it returns on their system? Guaranteed no harm done - it just reads and is likely to fail, if it does, with “”
do shell script "defaults read com.apple.LaunchServices | sed -n '/mailto;/{s/.*\\.\\(.*\\)\".*/\\1/p;}' "
--> "eudora" for my machine.
set dfb to read ((path to preferences as text) & "com.apple.LaunchServices.plist" as alias)
set x to offset of "<key>U:mailto</key>" in dfb
set dfb to text x thru (x + 800) of dfb
set x to offset of ("<key>LSBundleSignature</key>" & (ASCII character 10) & tab & tab & tab & tab & "<string>") in dfb
set dfb to text (x + 41) thru (x + 44) of dfb
On my machine it fails with “text x thru (x + 800)” highlighted. The message is fairly mysterious (just cut and pasted here, so not all characters come through:
It turns out to be very difficult to reliably find out what the default applications are for mailing, browsing, and ftp. As delivered, Tiger defaults to Safari and Mail, but doesn’t record that anywhere. If you switch to another mailer or browser as your default, then an entry is made in LaunchServices, but that can appear in two places: the ~/Library/Prefs or the /Library/Prefs. Further, in 10.3.x the entries were different and and names were sometimes truncated. Ugh.