From 8a1592d4b61b350f50bb6c8bb92e36dbbaa66b84 Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Mon, 15 Jun 2020 11:23:16 +0200 Subject: [PATCH 1/2] Make sure we have an active score --- src/Run.mss | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Run.mss b/src/Run.mss index dca4374..737175e 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('No score to convert. Can not 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); From eafbdff722565d7d9f6bc0f533b371869d66483c Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Mon, 15 Jun 2020 20:18:55 +0200 Subject: [PATCH 2/2] Message when no active score was found --- src/Run.mss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Run.mss b/src/Run.mss index 737175e..24e9643 100644 --- a/src/Run.mss +++ b/src/Run.mss @@ -49,7 +49,7 @@ function DoExport (filename) { Self._property:ActiveScore = Sibelius.ActiveScore; if (Self._property:ActiveScore = null) { - Sibelius.MessageBox('No score to convert. Can not export to ' & filename); + Sibelius.MessageBox('Could not find an active score. Cannot export to ' & filename); return false; }