Open mail on Windows

Ken Ray kray at sonsothunder.com
Tue Jul 10 10:04:28 CDT 2007


On Mon, 09 Jul 2007 14:44:03 +0200, Signe Marie Sanne wrote:

> On Windows NT, with latest engines and MetaCard 2.8.1, the following 
> script does not work any more. Suggestions?

Yes, try this (it's a stripped down version of my stsGoURL function):

on OpenMail pMailToURL
  switch (the platform)
  case "MacOS"  -- assumes OS X
    get shell("open" && q(pMailToURL))
    break
  case "Win32"
    put (word 1 of the systemVersion is "NT") into tIsNT
    if $COMSPEC <> "" then
      set the shellCommand to $COMSPEC
    else
      if tIsNT then
        set the shellCommand to "cmd.exe"
      else
        set the shellCommand to "command.com"
      end if
    end if

    put queryRegistry("HKEY_CLASSES_ROOT\mailto\shell\open\command\") 
into tMailApp
    -- replace placeholders for all Win versions (%1 for non-XP modern, 
%l for old, %ProgramFiles% for XP)
    replace q("%1") with pMailToURL in tMailApp
    replace "%1" with pMailToURL in tMailApp
    replace q("%l") with pMailToURL in tMailApp
    replace "%l" with pMailToURL in tMailApp
    replace "%ProgramFiles%" with $PROGRAMFILES in tMailApp
    open process tMailApp for neither
    break
  end switch
end OpenMail

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



More information about the use-livecode mailing list