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: Wed, 8 Feb 2006 21:52:47 -0400
Bingo, Kai, for me. OMM I get "Eudora" and "Camino". Resetting these to others still produce the correct answers for me.
On 2/8/06, kai
<email@hidden> wrote:
On 8 Feb 2006, at 22:58, Matt Deatherage wrote:
> Since no one else has said this, I'll chime in: this is the best
> approach currently available, even if it needs refinement to fix
> errors.
I've been playing with some variations - although, in view of the
inconsistent results so far, I'm still unsure about how they might
fare on different machines. Any feedback, particularly from those for
whom the previous effort failed (or for whom these versions now
fail), would be welcome.
--------------------
on defaultEmailApp()
set p to POSIX path of (path to preferences) &
"com.apple.LaunchServices.plist"
tell application "System Events" to tell property list item
"LSHandlerRoleAll" of (property list item 1 ¬
of property list item "LSHandlers" of property list file p whose
value contains "mailto") to if exists then
set v to value
tell application "Finder" to set {name:n, name extension:e} to
application file id v
tell (count e) + 1 to return n's text 1 thru -(1 mod it + it)
end if
"Mail"
end defaultEmailApp
defaultEmailApp()
--> "Mail" (OMM)
--------------------
The browser version is very similar:
--------------------
on defaultBrowser()
set p to POSIX path of (path to preferences) &
"com.apple.LaunchServices.plist"
tell application "System Events" to tell property list item
"LSHandlerRoleAll" of (property list item 1 ¬
of property list item "LSHandlers" of property list file p whose
value contains "http") to if exists then
set v to value
tell application "Finder" to set {name:n, name extension:e} to
application file id v
tell (count e) + 1 to return n's text 1 thru -(1 mod it + it)
end if
"Safari"
end defaultBrowser
defaultBrowser()
--> "Safari" (OMM)
--------------------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
--
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