Opening a PDF

Ken Ray kray at
Mon Dec 31 12:56:01 EST 2001


On Windows, you can use the shell() command, like this:

    set the hideConsoleWindows to true
    get shell("C:\mypdf.pdf")

On a Mac, you can use AppleScript to do it:

    tell application "Finder"
      open file "My Hard Disk:mypdf.pdf"
    end tell

using the "do <script> as applescript" command.

To find out if Acrobat is installed, you can check (on Windows) the
following registry key:


which will give you the path to the currently installed version of Acrobat
(you'll have to strip out quotes and %1 parameters, but you get the idea).

I'm not sure of the best way to see if Mac Acrobat is installed other than
looking where is *should* be. Perhaps there's an AppleScript that can be

Ken Ray
Sons of Thunder Software
Email: kray at
Web Site:

----- Original Message -----
From: "Dan Friedman" <dan at>
To: <use-revolution at>
Sent: Monday, December 31, 2001 10:09 AM
Subject: Opening a PDF

> Hello,
> I'm sure this topic has already been dealt with before (I can't be the
> one who wanted to do this), but, does anyone know a way to open a pdf file
> without knowing the path to Acrobat? (I need to do this on both Mac and
> Windows)
> As far as I know, the only way to do this is:
> launch "/HardDrive/aFolder/mypdf.pdf" with <Acrobat>
> But, you have to know the path to <Acrobat>.
> If you know how to do this, I would love it if you can provide a code
> snippet.  Also, how do you know if it was successful?  I would like to
> present a dialog to the user if Acrobat isn't installed.
> Thank you in advance for your time,
> Dan Friedman
> ClearVision Technologies, Inc.
> _______________________________________________
> use-revolution mailing list
> use-revolution at

More information about the use-livecode mailing list