Launch pdf on cd

Chipp Walters chipp at chipp.com
Sun Feb 13 19:42:40 EST 2005


Thanks Jan for the altBrowser plug. But, as much as I'd like to sell 
another copy of altBrowser, there's a way to do this on MacOSX. Launch 
works well on PC, but for MacOS X you need to do a little extra work:

on viewPDF_MacOSX pPDFpath
   if "AppleScript" is not among the lines of the alternateLanguages then
     answer "AppleScript must be installed."
     exit to top
   end if
   put revMacFromUnixPath(pPDFpath) into pPDFpath

   --> THIS ASSUMES YOU'VE JUST DOWNLOADED A .PDF FILE
   --> AND THE CREATOR AND FILETYPE AREN'T PROPERLY SET
   put "tell application " &quote& "Finder" & quote & cr into tScript
   put "set the creator type of file " &quote& pPDFpath &quote& \
       " to " &quote& "CARO" &quote& cr after tScript
   put "set the file type of file " &quote& pPDFpath &quote& \
       " to " &quote& "PDF " &quote& cr after tScript
   put "end tell" after tScript
   do tScript as Applescript
   put the result into sError

   put "tell application " &quote& "Finder" & quote & cr into tScript
   put "open file " &quote& pPDFpath &quote & cr after tScript
   put "end tell" after tScript
   do tScript as Applescript
   put the result into sError

end viewPDF_MacOSX


Jan Schenkel wrote:
> --- Stephen Van Esch <vanesch at yahoo.com> wrote:
> 
>>Folks:
>>
>>I've searched through the archives and haven't found
>>a
>>satisfactory answer. Here's what I'd like to do:
>>
>>When a user clicks a link, I'd like the PDF viewer
>>(Acrobat or Preview) to launch and display a
>>specified
>>pdf located on the CD.


More information about the use-livecode mailing list