On Tue, 5 Feb 2008 14:15:05 +0000, achapin <> wrote:
>The second is that when I got to help>Getting Started Guide I get a "file can not be found" error and it tries to open Adobe Pro 8. Does this program install it's own little version of Adobe reader that installing Adobe Pro may have broken? If I browse for the file after I clear the error, it will open with no problems. That, unfortunately, is not good enough for the powers that be.
The problem is either a bug in the "AecGettingStartedGuide" command or, more
likely, due to how Acrobat configures itself to launch a PDF file. If you check
out the .PDF extension in the Registry,, then chase things down, you find that
it's a horribly complicated and easy-to-break affair.
As a result, Acrobat is probably trying to launch "C:\Program.PDF,"
"files\AutoCAD.pdf," "Architecture.pdf," and 2008\Help\aca_gsg.pdf" - that's why
you have to hit OK a half-dozen times when you launch it.
Basically, you need to encapsulate the path to the "aca_gsg.pdf" file in double
quotes.
You can solve this by rewriting the command thusly:
(defun c:AecGettingStartedGuide (/ k p f)
;; Get the path to acrobat.exe from the Registry
;; I think this is common to any version of Acrobat.
;; But I could be wrong.
;; Stupid Adobe.
(setq k "HKEY_CLASSES_ROOT\\acrobat\\shell\\open\\command")
(setq p (vl-registry-read k))
;; removes the " /u \"%1\" from the resultant string
(setq p (substr p 1 (- (strlen p) 8)))
;; get the path to the Getting Started Guide, adding quotes
(setq f (strcat "\"" (findfile "aca_gsg.pdf") "\""))
;; Launch it
(startapp p f)
(princ)
)
You can put this code into your acaddoc.lsp file which needs to be in your
support path.
No modification to the CUI entry is required.
Obviously, this won't work if you do not have Acrobat installed and use some 3rd
party PDF reader, but this can also be worked around.
Matt
mstachoni@verizon.net
mstachoni@bhhtait.com