diff --git a/library/PDFSTREAM b/library/PDFSTREAM
index 1534669e..9565197a 100644
--- a/library/PDFSTREAM
+++ b/library/PDFSTREAM
@@ -1,12 +1,12 @@
 (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
 
-(FILECREATED " 1-Oct-2023 20:53:05" {WMEDLEY}<library>PDFSTREAM.;54 13917  
+(FILECREATED " 9-Oct-2023 00:42:25" {DSK}<home>frank>il>medley>gmedley>library>PDFSTREAM.;2 14029  
 
-      :EDIT-BY rmk
+      :CHANGES-TO (FNS SEE-PDF OPEN-PDF-STREAM PS-TO-PDF PDFCONVERTER)
+                  (VARS PDFSTREAMCOMS)
 
-      :CHANGES-TO (FNS SEE-PDF)
-
-      :PREVIOUS-DATE " 1-Oct-2023 15:29:33" {WMEDLEY}<library>PDFSTREAM.;53)
+      :PREVIOUS-DATE " 1-Oct-2023 20:53:05" {DSK}<home>frank>il>medley>gmedley>library>PDFSTREAM.;1
+)
 
 
 (PRETTYCOMPRINT PDFSTREAMCOMS)
@@ -39,12 +39,13 @@
         
         (* ;; "Implementation of PDF streams")
 
-        (INITVARS (PDFCONVERTER 'ps2pdf))
+        (INITVARS (PDFCONVERTER NIL))
                                                              (* ; "Mac with ghostscript?")
         (ALISTS (PDF-CONVERTER-TEMPLATES ps2pdf pstopdf))
         (GLOBALVARS PDFCONVERTER PDF-CONVERTER-TEMPLATES)
         (FNS OPEN-PDF-STREAM CLOSE-PDF-STREAM PS-TO-PDF)
-        (FNS SEE-PDF)))
+        (FNS SEE-PDF)
+        (FNS PDFCONVERTER)))
 
 (FILESLOAD (SYSLOAD)
        POSTSCRIPTSTREAM)
@@ -132,7 +133,7 @@
 (* ;; "Implementation of PDF streams")
 
 
-(RPAQ? PDFCONVERTER 'ps2pdf)
+(RPAQ? PDFCONVERTER NIL)
 
 
 
@@ -166,9 +167,9 @@
              (* ;; "If FILE is on the LPT device, we could just ssume that it can be printed directly, no point in converting.  But then we would alo have to lie and give it a PDF extension so it thinks that we are heading to a PDF printer.")
 
              (OPENPOSTSCRIPTSTREAM FILE OPTIONS)
-      else (CL:UNLESS (OR (ASSOC (OR PDFCONVERTER (MKATOM (UNIX-GETENV "MEDLEY-PDFCONVERTER")))
-                                 PDF-CONVERTER-TEMPLATES))
-                  (ERROR "POSTSCRIPT-to-PDF converter is not specified"))
+      else (CL:UNLESS (ASSOC (PDFCONVERTER)
+                             PDF-CONVERTER-TEMPLATES)
+                  (ERROR "A specified POSTSCRIPT-to-PDF converter cannot be found"))
            (SETQ FILE (OR (AND (NEQ FILE T)
                                (OUTFILEP FILE))
                           (ERROR "PDF target file not found" FILE)))
@@ -216,6 +217,9 @@
     (SETQ PSFILE (FULLNAME (TRUEFILENAME PSFILE)))
     (CL:UNLESS (INFILEP PSFILE)
            (ERROR "NO PS FILE TO CONVERT"))
+    (CL:UNLESS (ASSOC (PDFCONVERTER)
+                      PDF-CONVERTER-TEMPLATES)
+           (ERROR "A specified POSTSCRIPT-to-PDF converter cannot be found"))
     (SETQ PDFFILE (if PDFFILE
                       then (TRUEFILENAME PDFFILE)
                     else (PACKFILENAME 'EXTENSION 'pdf 'BODY PSFILE)))
@@ -237,10 +241,7 @@
                                                               (ERRORFILE \, (SLASHIT (TRUEFILENAME
                                                                                       ERRORFILE)
                                                                                    NIL T)))
-                                                            (ASSOC (OR PDFCONVERTER
-                                                                       (MKATOM (UNIX-GETENV 
-                                                                                "MEDLEY-PDFCONVERTER"
-                                                                                      )))
+                                                            (ASSOC (PDFCONVERTER)
                                                                    PDF-CONVERTER-TEMPLATES]
 
          (* ;; "Now use Medley names")
@@ -263,14 +264,21 @@
   [LAMBDA (PDFFILE)                                          (* ; "Edited  1-Oct-2023 20:47 by rmk")
                                                              (* ; "Edited 26-Sep-2023 16:52 by rmk")
 
-    (* ;; "Good for Mac, not sure about Windows etc.")
+    (* ;; "Use the ShellOpener for this machine to open the PDF file outside of Medley")
 
-    (ShellCommand (CONCAT "open -a Preview " (UNIX-FILE-NAME (PACKFILENAME 'BODY PDFFILE 'EXTENSION
-                                                                    'PDF)
-                                                    'INPUT])
+    (ShellOpen (PACKFILENAME 'BODY PDFFILE 'EXTENSION 'PDF])
+)
+(DEFINEQ
+
+(PDFCONVERTER
+  [LAMBDA NIL
+    (SETQ PDFCONVERTER (OR PDFCONVERTER (MKATOM (UNIX-GETENV "MEDLEY-PDFCONVERTER"))
+                           (CAR (for TEMPLATE in PDF-CONVERTER-TEMPLATES
+                                   thereis (ShellWhich (CAR TEMPLATE])
 )
 (DECLARE%: DONTCOPY
-  (FILEMAP (NIL (3078 5692 (PDFFILEP 3088 . 4002) (PDF.HARDCOPYW 4004 . 4602) (PDF.TEXT 4604 . 5321) (
-PDF.TEDIT 5323 . 5690)) (6136 13355 (OPEN-PDF-STREAM 6146 . 8324) (CLOSE-PDF-STREAM 8326 . 9613) (
-PS-TO-PDF 9615 . 13353)) (13356 13894 (SEE-PDF 13366 . 13892)))))
+  (FILEMAP (NIL (3208 5822 (PDFFILEP 3218 . 4132) (PDF.HARDCOPYW 4134 . 4732) (PDF.TEXT 4734 . 5451) (
+PDF.TEDIT 5453 . 5820)) (6262 13322 (OPEN-PDF-STREAM 6272 . 8408) (CLOSE-PDF-STREAM 8410 . 9697) (
+PS-TO-PDF 9699 . 13320)) (13323 13721 (SEE-PDF 13333 . 13719)) (13722 14006 (PDFCONVERTER 13732 . 
+14004)))))
 STOP
diff --git a/library/PDFSTREAM.LCOM b/library/PDFSTREAM.LCOM
index 12da811e..4c281d83 100644
Binary files a/library/PDFSTREAM.LCOM and b/library/PDFSTREAM.LCOM differ
diff --git a/library/UNIXUTILS b/library/UNIXUTILS
index 2150c55e..ec67d36c 100644
--- a/library/UNIXUTILS
+++ b/library/UNIXUTILS
@@ -1,12 +1,11 @@
 (DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
 
-(FILECREATED " 8-Oct-2023 15:06:52" {DSK}<home>frank>il>medley>gmedley>library>UNIXUTILS.;15 14696  
+(FILECREATED "10-Nov-2023 21:59:02" {DSK}<home>frank>il>medley>gmedley>library>UNIXUTILS.;24 16469  
 
-      :CHANGES-TO (FNS ShellOpen UNIX-FILE-NAME ShellBrowser ShellBrowse ShellOpener)
-                  (VARS UNIXUTILSCOMS)
+      :CHANGES-TO (FNS ShellOpen SLASHIT)
 
-      :PREVIOUS-DATE " 8-Oct-2023 02:35:47" {DSK}<home>frank>il>medley>gmedley>library>UNIXUTILS.;14
-)
+      :PREVIOUS-DATE "10-Nov-2023 19:34:44" 
+{DSK}<home>frank>il>medley>gmedley>docs>primer>UNIXUTILS.;10)
 
 
 (PRETTYCOMPRINT UNIXUTILSCOMS)
@@ -155,6 +154,7 @@
 
     (* ;; " Returns T is all goes well; returns an error string if all does not go well")
 
+    (RANDSET T)
     (SETQ FilenameOrURL (MKSTRING FilenameOrURL))
     (if (OR (EQ (STRPOS "http://" (L-CASE FilenameOrURL))
                 1)
@@ -172,13 +172,42 @@
                                   T)
                     else (CONCAT "Unable to find a browser to open: " FilenameOrURL)))
       else
-      (LET ((OPENER (ShellOpener))
-            (UNIXFILE (UNIX-FILE-NAME FilenameOrURL 'INPUT T)))
-           (if (NOT UNIXFILE)
-               then (CONCAT "File not found: " FilenameOrURL)
-             elseif (NOT (STREQUAL OPENER "true"))
-               then (CL:WITH-OPEN-STREAM
-                     (SHELLSTREAM (OPENSTREAM (CONCAT "{CORE}SHELLOUT" (RAND))
+      (LET*
+       ((OPENER (ShellOpener))
+        (FULLNAME (FULLNAME FilenameOrURL)))
+       (if (NOT FULLNAME)
+           then (CONCAT "File not found: " FilenameOrURL)
+         elseif (STREQUAL OPENER "true")
+           then (CONCAT "Unable to find a file opener to open: " FilenameOrURL)
+         else (LET* ((VERSION.SPECIFIED (FILENAMEFIELD FilenameOrURL 'VERSION))
+                     (UNPACKED (UNPACKFILENAME.STRING FULLNAME))
+                     (NEWNAME (CONCAT (LISTGET UNPACKED 'NAME)
+                                     "~"
+                                     (LISTGET UNPACKED 'VERSION)
+                                     "~"))
+                     (EXTENSION (LISTGET UNPACKED 'EXTENSION))
+                     [UNVERSIONED (LET (FN (UNPACKED (COPY UNPACKED)))
+                                       (LISTPUT UNPACKED 'VERSION NIL)
+                                       (LISTPUT UNPACKED 'HOST NIL)
+                                       (SETQ FN (PACKFILENAME.STRING UNPACKED))
+                                       (if (STREQUAL (SUBSTRING FN -1)
+                                                  ".")
+                                           then (SETQ FN (SUBSTRING UNIXFILE 1 -2)))
+                                       (SETQ FN (SLASHIT FN]
+                     (UNVERSIONED.EXISTS (INFILEP (CONCAT "{UNIX}" UNVERSIONED)))
+                     (TMPDIR (CONCAT "/tmp/" (RAND 1000 9999)))
+                     (TARGETFILE.LISP (PACKFILENAME.STRING 'HOST "{UNIX}" 'DIRECTORY TMPDIR
+                                             'NAME NEWNAME 'EXTENSION EXTENSION))
+                     (TARGETFILE.UNIX (SLASHIT (PACKFILENAME.STRING 'HOST NIL 'DIRECTORY TMPDIR
+                                                      'NAME NEWNAME 'EXTENSION EXTENSION)))
+                     (UNIXFILE NIL))
+                    (DECLARE (SPECVARS UNIXFILE))
+                    (if (OR VERSION.SPECIFIED (NOT UNVERSIONED.EXISTS))
+                        then (COPYFILE FULLNAME TARGETFILE.LISP)
+                             (SETQ UNIXFILE TARGETFILE.UNIX)
+                      else (SETQ UNIXFILE UNVERSIONED))
+                    (CL:WITH-OPEN-STREAM
+                     (SHELLSTREAM (OPENSTREAM (CONCAT "{CORE}SHELLOUT" (RAND 1000 9999))
                                          'BOTH))
                      (ShellCommand (CONCAT OPENER " '" UNIXFILE "'" 
                                           " >>/tmp/ShellOpener-warnings-$$.txt")
@@ -197,8 +226,7 @@
                                                 (CL:LOOP (PRINTCCODE (READCCODE SHELLSTREAM)
                                                                 STRINGSTREAM))
                                                 OUT))
-                                  OUTSTRING)))
-             else (CONCAT "Unable to find a file opener to open: " FilenameOrURL])
+                                  OUTSTRING])
 
 (PROCESS-COMMAND
   [LAMBDA (CMD)                                              (* ; "Edited 17-Jul-2022 08:17 by rmk")
@@ -221,8 +249,8 @@
 
     (LET [LASTDIRPOS SLASHED (DIRPOS (ADD1 (OR (STRPOS "}" X)
                                                0]
-         [SETQ SLASHED (CONCATCODES (FOR I C FROM DIRPOS WHILE (SETQ C (NTHCHARCODE X I))
-                                       COLLECT (SELCHARQ C
+         [SETQ SLASHED (CONCATCODES (for I C from DIRPOS while (SETQ C (NTHCHARCODE X I))
+                                       collect (SELCHARQ C
                                                     ((< >) 
                                                          (SETQ LASTDIRPOS I)
                                                          (CHARCODE /))
@@ -285,7 +313,7 @@
 
 (PUTPROPS UNIXUTILS FILETYPE CL:COMPILE-FILE)
 (DECLARE%: DONTCOPY
-  (FILEMAP (NIL (1144 1517 (ShellCommand 1144 . 1517)) (1519 1916 (ShellWhich 1519 . 1916)) (1917 14618 
-(ShellBrowser 1927 . 3675) (ShellBrowse 3677 . 4362) (ShellOpener 4364 . 6052) (ShellOpen 6054 . 9357)
- (PROCESS-COMMAND 9359 . 9972) (SLASHIT 9974 . 12016) (UNIX-FILE-NAME 12018 . 14616)))))
+  (FILEMAP (NIL (1065 1438 (ShellCommand 1065 . 1438)) (1440 1837 (ShellWhich 1440 . 1837)) (1838 16391 
+(ShellBrowser 1848 . 3596) (ShellBrowse 3598 . 4283) (ShellOpener 4285 . 5973) (ShellOpen 5975 . 11130
+) (PROCESS-COMMAND 11132 . 11745) (SLASHIT 11747 . 13789) (UNIX-FILE-NAME 13791 . 16389)))))
 STOP
diff --git a/library/UNIXUTILS.DFASL b/library/UNIXUTILS.DFASL
index 8cfdae7d..991032ba 100644
Binary files a/library/UNIXUTILS.DFASL and b/library/UNIXUTILS.DFASL differ
