(JAL-1022) reverted to original strategy of escaping filenames in Jmol scripts becaus...
[jalview.git] / src / jalview / gui / AppJmol.java
index bd86275..93a2994 100644 (file)
@@ -35,6 +35,7 @@ import jalview.structure.*;
 import jalview.datamodel.PDBEntry;
 import jalview.io.*;
 import jalview.schemes.*;
+import jalview.util.Platform;
 
 public class AppJmol extends GStructureViewer implements Runnable,
         SequenceStructureBinding, ViewSetProvider
@@ -723,10 +724,10 @@ public class AppJmol extends GStructureViewer implements Runnable,
             // just transfer the file name from the first sequence's first
             // PDBEntry
             file = new File(((PDBEntry) pdbseq
-                    .getSequenceAt(0).getPDBId().elementAt(0)).getFile()).toURI().getPath().substring(1);
+                    .getSequenceAt(0).getPDBId().elementAt(0)).getFile()).getAbsolutePath();
             jmb.pdbentry[pi].setFile(file);
             
-            files.append(" \"" + file + "\"");
+            files.append(" \"" + Platform.escapeString(file) + "\"");
           }
           else
           {
@@ -749,7 +750,7 @@ public class AppJmol extends GStructureViewer implements Runnable,
           }
           if (file != null)
           {
-            files.append(" \"" + file + "\"");
+            files.append(" \"" + Platform.escapeString(file) + "\"");
           }
         }
       }