• 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: John Baltutis <email@hidden>
  • Date: Tue, 7 Feb 2006 16:27:30 -0800

On 02/07/06, "J. Stewart" <email@hidden> wrote:
>
> Yet another method of determining the default browser. This is for theless
>regex inclined :)
>
> --> cut <--
> set defaultBrowser to word -1 of (do shell script "defaults read
>com.apple.LaunchServices | grep -C5 E:html  | grep -w LSBundleSignature")
> tell application "Finder" to name of application file id defaultBrowser
> --> cut <--
>
> The previously posted regex methods failed to return anything (just an emopty
>string) on mine or Kai's machines. This method returns "Safari.app"OMM.

As mentioned before, since I've never set another browser than Safari as
default, this snippet returns:

set defaultBrowser to word -1 of (do shell script "defaults read
com.apple.LaunchServices | grep -C5 E:html  |grep -w LSBundleSignature")
tell application "Finder"to name of application file id defaultBrowser

->"The command exited with a non-zero status."

indicating that there's no html object within the LaunchServices plist file.
For this case, if the regex methods return "", then you could test for that and
assume that the default's Safari. Likewise, if a check for mailto returns "",
assume Mail is the default mailer.
 _______________________________________________
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

  • Prev by Date: Another Shell Script question ftp
  • Next by Date: Re: Another Shell Script question ftp
  • Previous by thread: Re: Determining the Default Mail App
  • Next by thread: Re: Determining the Default Mail App
  • Index(es):
    • Date
    • Thread