Re: Determining the Default Mail App
Re: Determining the Default Mail App
- Subject: Re: Determining the Default Mail App
- From: Adam Bell <email@hidden>
- Date: Mon, 6 Feb 2006 14:54:53 -0400
And, substituting "http" for "mailto" produces the default browser too. Excellent.
On 2/6/06, Gnarlodious <
email@hidden> wrote:
You can get rid of more Applescript by setting the opening delimiter to \\. Instead of \"
So:
do shell script "defaults read com.apple.LaunchServices | sed -n '/mailto;/{s/.*\\.\\(.*\\)\".*/\\1/p;}' "
--> entourage
-- Gnarlie
Entity Adam Bell spoke thus:
Nothing more than replacing 'mailto' with 'http' did the trick:
do shell script "defaults read com.apple.LaunchServices | sed -n '/http;/{s/.*\"\\(.*\\)\".*/\\1/p;}' "
--> "org.mozilla.camino "
so, at least in 10.4.4, this gets both the default browser and the default emailer:
set DI to {"mailto", "http"}
set _defaults to {}
repeat with aI in DI
set D to (do shell script "defaults read com.apple.LaunchServices | sed -n '/" & aI & ";/{s/.*\"\\(.*\\)\".*/\\1/p;}' ")
set {TID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "."}
set end of _defaults to text item 3 of D
set AppleScript's text item delimiters to TID
end repeat
_defaults --> {"eudora", "camino"}
On 2/6/06, Gnarlodious <email@hidden> wrote:
Same here, 10.4.4.
10.3 had an entirely different system for keeping track of the default apps,
this method will not work on 10.3.x.
I don't even remember what the 10.3 system is like. I believe the pertinent
file is at
/Library/Preferences/SystemConfiguration/preferences.plist
If you post the part of that file that has the email app I'll try to work it
out.
Adam:
You can get the default browser by replacing "mailto" with "http". My output
does not have a 3 line text block. I'd suggest keeping it simple until the
hotdoggers at Apple get LaunchServices hammered out.
Be sure to post your final result so I can use it too.
-- Gnarlie
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden
<mailto:email@hidden> )
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (
--
Some minds remain open long enough for a truth to both enter and leave without processing.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden