On 4/5/06 9:05 AM, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I need to detect the presence of Adobe Reader (and the version if possible) on
>
> Windows 98 thru XP, Mac OS9, and Mac OSX. I have searched the archives, but
> the
>
> code I found there was for starting and running Reader with a pdf file. I just
> need
>
> to "silently" detect its presence or absence.
Here's a function I use (watch for line wraps):
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 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
And you could just test to see if stsPathToAcrobat() returns empty or not.
HTH,
Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution