revMail fails on some Macs

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


On 1/19/05 11:28 AM, "J. Landman Gay" <jacque at hyperactivesw.com> 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 "com.apple.mail" 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/com.apple.LaunchServices.pList") into
tData
  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 "com.microsoft.entourage"
        return "Entourage"
        break
      case "com.apple.mail"
        return "Mail"
        break
      case "com.outspring.quickmail"
        return "QuickMail"
        break
      default
        return "Other"
        break
      end switch
    end if
  end if
  return ""
end stsDefaultMailClient

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list