Opening a PDF
Ken Ray
kray at sonsothunder.com
Mon Dec 31 12:56:01 EST 2001
Dan,
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:
get
queryRegistry("HKEY_CLASSES_ROOT\AcroExch.Document\shell\open\command\")
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
used?
Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
----- Original Message -----
From: "Dan Friedman" <dan at clearvisiontech.com>
To: <use-revolution at lists.runrev.com>
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
first
> 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 lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list