• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Determining the Default Mail App
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining the Default Mail App


  • Subject: Re: Determining the Default Mail App
  • From: Adam Bell <email@hidden>
  • Date: Mon, 6 Feb 2006 15:20:57 -0400

That is strange, because if I change my default browser to Safari, the short form still works for me:

set DI to {"mailto", "http"}
set _defaults to {}
repeat with aI in DI
    set end of _defaults to (do shell script "defaults read com.apple.LaunchServices | sed -n '/" & aI & ";/{s/.*\\.\\(.*\\)\".*/\\1/p;}' ")
end repeat
_defaults --> {"eudora", "safari"}

On 2/6/06, kai <email@hidden> wrote:

On 6 Feb 2006, at 18:54, Adam Bell wrote:

> And, substituting "http" for "mailto" produces the default browser
> too. Excellent.

Not here, I'm afraid (10.4.4):

---------------

do shell script "defaults read com.apple.LaunchServices | sed -n '/
mailto;/{s/.*\\.\\(.*\\)\".*/\\1/p;}' "

--> "mail"

---------------

do shell script "defaults read com.apple.LaunchServices | sed -n '/
http;/{s/.*\\.\\(.*\\)\".*/\\1/p;}' "

--> ""

---------------

This, however, does work:

---------------

set l to {"mailto", "http"}
set p to POSIX path of (path to preferences) &
"com.apple.LaunchServices.plist"
repeat with i in l
        tell application "System Events" to set v to value of property list
item ¬
                "LSBundleIdentifier" of property list item 1 of property list item ¬
                ("U:" & i) of property list item "LSPrefsBindings" of property list
file p
        tell application "Finder" to set i's contents to (get name of
application file id v)'s text 1 thru -5
end repeat
l

--> {"Mail", "Safari"}

---------------

---
kai


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (

This email sent to 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

References: 
 >Re: Determining the Default Mail App (From: Adam Bell <email@hidden>)
 >Re: Determining the Default Mail App (From: Gnarlodious <email@hidden>)
 >Re: Determining the Default Mail App (From: Adam Bell <email@hidden>)
 >Re: Determining the Default Mail App (From: kai <email@hidden>)

  • Prev by Date: Re: Determining the Default Mail App
  • Next by Date: Re: Various Qs about Intel and AppleScript
  • Previous by thread: Re: Determining the Default Mail App
  • Next by thread: Re: Determining the Default Mail App
  • Index(es):
    • Date
    • Thread