Re: Script to get default browser? > Philip
Re: Script to get default browser? > Philip
- Subject: Re: Script to get default browser? > Philip
- From: Mr Tea <email@hidden>
- Date: Fri, 10 Jan 2003 11:19:48 +0000
This from Philip Aker - dated 10-01-03 08.34 am:
>
Ok, second try.
Hi, Philip
Thanks for the info.
As posted, your script generated an error OMM (can't get text items 1 thru
-2 of com.microsoft.explorer), so I made a slight adjustment:
set lsbundle to (do shell script "defaults read com.apple.LaunchServices |
grep -C2 E:html | grep -w LSBundleIdentifier")
set blist to (words 3 thru -1 of lsbundle)
set res to ""
repeat with i from 1 to count of blist
set res to res & item i of blist & " "
end repeat
set AppleScript's text item delimiters to " "
set theBrowser to (text items 2 thru -2 of res) as string
set AppleScript's text item delimiters to ""
theBrowser
...which produced the result "microsoft explorer"
All well and good, but Safari set itself as my default browser when I first
ran it, and shows up as such in its own pref dialog and in the internet pane
of system prefs.
I switched the default back to MSIE, then reverted to Safari (in system
prefs), and got this result:
--> "microsoft explorer LSBundleIdentifier = com apple safari"
What's that about? Not that it matters. The info I want is in there, and
your method is roughly a million times faster than the solution posted by
Paul Skinner in this thread. :-)
Oh, and that scripting addition... Yes please.
Thanks again,
Mr Tea
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.