diff --git a/swing/src/net/sf/openrocket/gui/util/EditDecalHelper.java b/swing/src/net/sf/openrocket/gui/util/EditDecalHelper.java index 6059848d2..5a790951f 100644 --- a/swing/src/net/sf/openrocket/gui/util/EditDecalHelper.java +++ b/swing/src/net/sf/openrocket/gui/util/EditDecalHelper.java @@ -8,6 +8,8 @@ import java.text.MessageFormat; import net.sf.openrocket.appearance.AppearanceBuilder; import net.sf.openrocket.appearance.DecalImage; +import net.sf.openrocket.arch.SystemInfo; +import net.sf.openrocket.arch.SystemInfo.Platform; import net.sf.openrocket.document.OpenRocketDocument; import net.sf.openrocket.gui.dialogs.EditDecalDialog; import net.sf.openrocket.gui.watcher.FileWatcher; @@ -179,6 +181,15 @@ public class EditDecalHelper { command = commandTemplate + " " + filename; } + /* On OSX, the program needs to be opened using the command + * open -a to tell it which application to use to open the + * program. Check to see if the command starts with it or not + * and pre-pend it as necessary. See issue #619. + */ + if (SystemInfo.getPlatform() == Platform.MAC_OS && !command.startsWith("open -a")) { + command = "open -a " + command; + } + try { Runtime.getRuntime().exec(command); } catch (IOException ioex) {