I'm trying to modify our PDF plotting routine. This is what I'm trying to do:

Check if PDF exist
Delete PDF
If PDF can't be deleted, I need an alert window to close pdf.
If alert window is closed and PDF still exist, show alert window
once the PDF is closed it would then be deleted and continue to make a new pdf.

Here is part of the code I'm trying to work with:

Code:
(setq pdfsave (strcat (getvar "dwgprefix") SSDN ".pdf"));;sets the pdf name, SSDN is Ctab

(if 
  (findfile (strcat (getvar "dwgprefix") SSDN ".pdf"))
    (vl-file-delete (strcat (getvar "dwgprefix") SSDN ".pdf"))
      (While
        (findfile (strcat (getvar "dwgprefix") SSDN ".pdf"))
          (progn
            (alert "Please Close PDF")
             (vl-file-delete (strcat (getvar "dwgprefix") SSDN ".pdf"))
          );;progn
      );;while
);;if
Any help would be great,
Chris