diff --git a/src/ucar/unidata/idv/ui/ImageGenerator.java b/src/ucar/unidata/idv/ui/ImageGenerator.java index d39ee3ae1..255b7491a 100755 --- a/src/ucar/unidata/idv/ui/ImageGenerator.java +++ b/src/ucar/unidata/idv/ui/ImageGenerator.java @@ -3984,7 +3984,15 @@ private String applyMacros(String s, Hashtable props, boolean doTime) { s = StringUtil.applyMacros(s, getStateManager().getProperties(), false); if (s.indexOf("${") >= 0) { - throw new BadIslException("Undefined macro in: " + s); + Hashtable optionArgs = getIdv().getArgsManager().getOptionalArgs(); + if(optionArgs.size() > 0){ + s = StringUtil.applyMacros(s, optionArgs, + false); + if(s.indexOf("${") >= 0) { + throw new BadIslException("Undefined macro in: " + s); + } + } else + throw new BadIslException("Undefined macro in: " + s); } if (s.startsWith("jython:")) {