revMail fails on some Macs

Ken Ray kray at
Wed Jan 19 13:35:12 EST 2005

On 1/19/05 11:28 AM, "J. Landman Gay" <jacque at> wrote:

> On 1/18/05 10:38 PM, Sivakatirswami wrote:
>> What exactly does the Mac need to ensure that there is an email client
>> automatically will be invoked by revMail? I can't find any preference in
>> OS X for "default mail app" that requires setting. No more internet
>> config and apple has this bizarre requirment to set the default browser
>> from within Safari,
> In Panther, they've done the same idiotic thing for email -- you have to
> set the default email reader from within Apple's Mail app.
> Jaguar was better, these settings were in the System prefs.

That information is in the LaunchServices.plist file... the problem is that
you can only get the company identifier (ilike "" and not the
*true* app name easily - I think the rest is obfuscated. Here's what I've
used in the past, but it only supports Apple Mail, Entourage, and QuickMail,
otherwise it returns "Other":

function stsDefaultMailClient
  -- Mac OS X only
  local tIdentifier,tPrefData
  put url("file:~/Library/Preferences/") into
  put lineOffset("<key>U:mailto</key>",tData) into tLine
  if tLine <> 0 then
    put lineOffset("</array>",tData,tLine) into tEndLine
    if tEndLine <> 0 then
      put line (tLine+1) to (tLine+tEndLine) of tData into tChunk
      get matchText(tChunk,"<string>(.*?)</string>",pIdentifier)
      get matchText(tChunk,"(?s)<data>(.*?)</data>",tPrefData)
      put base64Decode(tPrefData) into tPrefData
      replace null with "" in tPrefData
      set the itemDel to numToChar(18)
      put item 2 of tPrefData into tPath
      put charToNum(char 1 of tPath) into tLength
      delete char 1 of tPath
      put char 1 to tLength of tPath into pPath
      switch pIdentifier
      case ""
        return "Entourage"
      case ""
        return "Mail"
      case "com.outspring.quickmail"
        return "QuickMail"
        return "Other"
      end switch
    end if
  end if
  return ""
end stsDefaultMailClient


Ken Ray
Sons of Thunder Software
Web site:
Email: kray at

More information about the Use-livecode mailing list