Launch PDF's into Acrobat
Ken Ray
kray at sonsothunder.com
Fri May 13 22:20:54 EDT 2005
On 5/13/05 7:54 PM, "Sivakatirswami" <katir at hindu.org> wrote:
> Anyway, this would make a great "recipe" to add to others like XML
> Demo... PDF's are here to stay and will continue to be a defacto
> standard for data presentation. I think someone must already has this
> totally wired and functional. Possibly can all be done in a single
> script... if you have it, we would appreciate seeing that.
Here's Hugh Senior's script from the Scripter's Scrapbook that tests to see
if Acrobat is installed and offers to install it (note, it uses Hugh's
'smartAnswer' answer dialog replacement, but you can use one of your own). I
haven't tested it myself, but here it is:
on openPDF pFile
if isAcrobatInstalled()<>"true" then
askInstallAcrobat
else ... (launch file pFile) -- insert your code here
end openPDF
on askInstallAcrobat
put "Acrobat Reader is needed to preview and print this document. Do you
want to install the Acrobat Reader on your computer now?" into tStr
get smartAnswer("Adobe Acrobat Reader needs installing",tStr,"Yes","No")
if it="Yes" then installAcrobat
end askInstallAcrobat
on installAcrobat
global g_Volume
set the cursor to watch
set the itemDel to "/"
if the platform is "MacOS" then put g_Volume&"/MM pdf/Acrobat/Reader
Installer" into tAcroPath
else put g_Volume&"/MM pdf/Acrobat/Acrd4enu.exe" into tAcroPath
launch tAcroPath
end installAcrobat
function isAcrobatInstalled
get word 1 to -2 of
queryRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AcroExch.Document\shell\o
pen\command\")
return it<>""
end isAcrobatInstalled
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