diff --git a/src/Run.mss b/src/Run.mss index dca4374..24e9643 100644 --- a/src/Run.mss +++ b/src/Run.mss @@ -45,13 +45,18 @@ function DoExport (filename) { Self._property:libmei = libmei4; libmei.destroy(); - // Deal with the Progress GUI // set the active score here so we can refer to it throughout the plugin Self._property:ActiveScore = Sibelius.ActiveScore; + if (Self._property:ActiveScore = null) + { + Sibelius.MessageBox('Could not find an active score. Cannot export to ' & filename); + return false; + } // Set up the warnings tracker Self._property:warnings = CreateSparseArray(); + // Deal with the Progress GUI progCount = Sibelius.ActiveScore.SystemStaff.BarCount; fn = utils.ExtractFileName(filename); progressTitle = utils.Format(_InitialProgressTitle, fn);