Detecting Adobe Reader

Ken Ray kray at sonsothunder.com
Wed Apr 5 13:49:53 EDT 2006


On 4/5/06 12:44 PM, "Ken Ray" <kray at sonsothunder.com> wrote:

> Here's a function I use (watch for line wraps):

Whoops! Forgot the conversion from the Mac path that AppleScript returns.
Use this one instead:

function stsPathToAcrobat
  switch (the platform)
  case "MacOS"
    put format("tell app \"Finder\"") & cr & \
        format("get application file id \"CARO\" as text") & cr & \
        "end tell" into tScript
    do tScript as "AppleScript"
    if the result = "execution error" then return ""  -- doesn't exist
    else return revUnixFromMacPath(replaceText(the result,quote,""))
    break
  case "Win32"
    put "HKEY_CLASSES_ROOT\AcroExch.Document\shell\open\command\" into tKey
    put word 1 to -2 of queryRegistry(tKey) into tPath
    return replaceText(tPath,quote,"")
    break
  end switch
end stsPathToAcrobat

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