From 503685f9db9a9cd37212789dbd150dde18bcc529 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 13 Nov 2024 15:59:36 +0000 Subject: [PATCH] JAL-3921 escape and transform file paths for Jmol scripting environment --- src/jalview/gui/AppJmol.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index d37c9c0..6d57acd 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -45,6 +45,7 @@ import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; import jalview.datamodel.StructureViewerModel; import jalview.datamodel.StructureViewerModel.StructureData; +import jalview.ext.jmol.JmolCommands; import jalview.gui.ImageExporter.ImageWriterI; import jalview.gui.StructureViewer.ViewerType; import jalview.io.exceptions.ImageOutputException; @@ -153,8 +154,7 @@ public class AppJmol extends StructureViewerBase } }); StringBuilder cmd = new StringBuilder(); - cmd.append("load FILES ").append(QUOTE) - .append(Platform.escapeBackslashes(sessionFile)).append(QUOTE); + cmd.append(jmb.getCommandGenerator().loadFile(sessionFile)); initJmol(cmd.toString()); } @@ -301,7 +301,7 @@ public class AppJmol extends StructureViewerBase for (String s : files) { fileList.append(SPACE).append(QUOTE) - .append(Platform.escapeBackslashes(s)).append(QUOTE); + .append(JmolCommands.escapeQuotedFilename(s)).append(QUOTE); } String filesString = fileList.toString(); -- 1.7.10.2